diff options
author | jasone <jasone@FreeBSD.org> | 2000-06-27 21:30:16 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-06-27 21:30:16 +0000 |
commit | 685b55093c390c42f0371340e0c057c475c1af39 (patch) | |
tree | 0b6d43f7b9fcdca766faa281a3f499dc24828c6a /lib/libpthread/thread/thr_private.h | |
parent | 26efc47d384874586102325d5751243778fa6cbb (diff) | |
download | FreeBSD-src-685b55093c390c42f0371340e0c057c475c1af39.zip FreeBSD-src-685b55093c390c42f0371340e0c057c475c1af39.tar.gz |
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
Diffstat (limited to 'lib/libpthread/thread/thr_private.h')
-rw-r--r-- | lib/libpthread/thread/thr_private.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index 6b48f23..1ecda3c 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -930,6 +930,13 @@ SCLASS pthread_cond_t _gc_cond SCLASS struct sigaction _thread_sigact[NSIG]; /* + * Array of counts of dummy handlers for SIG_DFL signals. This is used to + * assure that there is always a dummy signal handler installed while there is a + * thread sigwait()ing on the corresponding signal. + */ +SCLASS int _thread_dfl_count[NSIG]; + +/* * Pending signals for this process. */ SCLASS sigset_t _process_sigpending; |