From 17ee572a14054fb3c892f9dc5ee491e75bc8f3f5 Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 17 Dec 1999 00:56:36 +0000 Subject: 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 --- lib/libpthread/thread/thr_kern.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/libpthread/thread/thr_kern.c') 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]); } } } -- cgit v1.1