diff options
author | deischen <deischen@FreeBSD.org> | 1999-12-17 00:56:36 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 1999-12-17 00:56:36 +0000 |
commit | 17ee572a14054fb3c892f9dc5ee491e75bc8f3f5 (patch) | |
tree | 5d51d9a812640e396f61d1c8d3b91b7f6c0cdba7 /lib/libpthread/thread/thr_kern.c | |
parent | 3bd28ea93ef0db4dbbbf6b6671392ccbc020a864 (diff) | |
download | FreeBSD-src-17ee572a14054fb3c892f9dc5ee491e75bc8f3f5.zip FreeBSD-src-17ee572a14054fb3c892f9dc5ee491e75bc8f3f5.tar.gz |
Fixes for signal handling:
o Don't call signal handlers with the signal handler access lock
held.
o Remove pending signals before calling signal handlers. If
pending signals were not removed prior to handling them,
invocation of the handler could cause the handler to be
called more than once for the same signal. Found by: JB
o When SIGCHLD arrives, wake up all threads in PS_WAIT_WAIT
(wait4).
PR: bin/15328
Reviewed by: jasone
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index cdb84a5..f69cb41 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -1076,6 +1076,7 @@ dequeue_signals(void) { char bufr[128]; int i, num; + pthread_t pthread; /* * Enter a loop to read and handle queued signals from the @@ -1096,7 +1097,11 @@ dequeue_signals(void) } else { /* Handle this signal: */ - _thread_sig_handle((int) bufr[i], NULL); + pthread = _thread_sig_handle((int) bufr[i], + NULL); + if (pthread != NULL) + _thread_sig_deliver(pthread, + (int) bufr[i]); } } } |