summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_sig.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2000-11-20 13:12:44 +0000
committerdeischen <deischen@FreeBSD.org>2000-11-20 13:12:44 +0000
commit400a63d9371bc2cbcaf8f96471830a389a432ae3 (patch)
tree2b6d687d1e4ab220fa896697275b5851f641d9e1 /lib/libpthread/thread/thr_sig.c
parent0f4c6ea8edac75412418c6978b7b2c208cff6798 (diff)
downloadFreeBSD-src-400a63d9371bc2cbcaf8f96471830a389a432ae3.zip
FreeBSD-src-400a63d9371bc2cbcaf8f96471830a389a432ae3.tar.gz
Change a "while {}" loop to a "do {} while" to allow it to be
executed at least once, fixing pthread_mutex_lock() for recursive mutex lock attempts. Correctly set a threads signal mask while it is executing a signal handler. The mask should be the union of its current mask, the signal being handled, and the mask from the signal action. Reported by: Dan Nelson <dnelson@emsphone.com> MFC Candidate
Diffstat (limited to 'lib/libpthread/thread/thr_sig.c')
-rw-r--r--lib/libpthread/thread/thr_sig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index 3ac9740..a855a61 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -1057,6 +1057,10 @@ thread_sigframe_add(pthread_t thread, int sig, int has_args)
sizeof(psf->siginfo));
}
+ /* Setup the signal mask: */
+ SIGSETOR(thread->sigmask, _thread_sigact[sig - 1].sa_mask);
+ sigaddset(&thread->sigmask, sig);
+
/* Set up the new frame: */
thread->curframe = psf;
thread->ctxtype = CTX_JB_NOSIG;
OpenPOWER on IntegriCloud