From 400a63d9371bc2cbcaf8f96471830a389a432ae3 Mon Sep 17 00:00:00 2001 From: deischen Date: Mon, 20 Nov 2000 13:12:44 +0000 Subject: 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 MFC Candidate --- lib/libkse/thread/thr_sig.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libkse/thread/thr_sig.c') diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index 3ac9740..a855a61 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/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; -- cgit v1.1