From 8d107d12102747d3d8691aea11c17e37f43fb70d Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 27 Jun 2000 21:30:16 +0000 Subject: If multiple threads are blocked in sigwait() for the same signal that does not have a user-supplied signal handler, when a signal is delivered, one thread will receive the signal, and then the code reverts to having no signal handler for the signal. This can leave the other sigwait()ing threads stranded permanently if the signal is later ignored, or can result in process termination when the process should have delivered the signal to one of the threads in sigwait(). To fix this problem, maintain a count of sigwait()ers for each signal that has no default signal handler. Use the count to correctly install/uninstall dummy signal handlers. Reviewed by: deischen --- lib/libpthread/thread/thr_init.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libpthread/thread/thr_init.c') diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index dd5f53fac64e..8e13f90dc993 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -277,6 +277,9 @@ _thread_init(void) */ PANIC("Cannot read signal handler info"); } + + /* Initialize the SIG_DFL dummy handler count. */ + _thread_dfl_count[i] = 0; } /* -- cgit v1.2.3