major improvements to cancellation handling

- there is no longer any risk of spoofing cancellation requests, since
  the cancel flag is set in pthread_cancel rather than in the signal
  handler.

- cancellation signal is no longer unblocked when running the
  cancellation handlers. instead, pthread_create will cause any new
  threads created from a cancellation handler to unblock their own
  cancellation signal.

- various tweaks in preparation for POSIX timer support.
This commit is contained in:
Rich Felker
2011-03-29 12:58:22 -04:00
parent 70c31c7bd7
commit bf619d82c8
4 changed files with 19 additions and 8 deletions
+5 -2
View File
@@ -41,10 +41,14 @@ struct pthread {
long off;
void *pending;
} robust_list;
int unblock_cancel;
};
struct __timer {
struct sigevent sev;
int timerid;
union sigval val;
void (*notify)(union sigval);
pthread_t thread;
};
#define __SU (sizeof(size_t)/sizeof(int))
@@ -73,7 +77,6 @@ struct __timer {
#define SIGCANCEL 32
#define SIGSYSCALL 33
#define SIGTIMER 32 /* ?? */
int __set_thread_area(void *);
int __libc_sigaction(int, const struct sigaction *, struct sigaction *);