summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-09-15 00:08:48 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-09-15 00:08:48 +0000
commit1d188498a377a60374ee55902801aa8330743660 (patch)
tree4f9ea3fdba9e39e02cb6a7b00261fa3c00f87058 /lib/libpthread/thread
parent8d7f2fb3904b665f5c51e664e1c01dbb48f9fa5c (diff)
downloadFreeBSD-src-1d188498a377a60374ee55902801aa8330743660.zip
FreeBSD-src-1d188498a377a60374ee55902801aa8330743660.tar.gz
Fix bogus comment and assign sigmask in critical region, use
SIG_CANTMASK to remove unmaskable signal masks.
Diffstat (limited to 'lib/libpthread/thread')
-rw-r--r--lib/libpthread/thread/thr_sig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index 1f1f0b4..ad51631 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -347,9 +347,9 @@ _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp)
err_save = errno;
timeout_save = curthread->timeout;
intr_save = curthread->interrupted;
- /* Get a fresh copy of signal mask, for thread dump only */
- curthread->sigmask = ucp->uc_sigmask;
_kse_critical_enter();
+ /* Get a fresh copy of signal mask */
+ curthread->sigmask = ucp->uc_sigmask;
KSE_LOCK_ACQUIRE(curkse, &_thread_signal_lock);
sigfunc = _thread_sigact[sig - 1].sa_sigaction;
sa_flags = _thread_sigact[sig - 1].sa_flags & SA_SIGINFO;
@@ -394,6 +394,7 @@ _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp)
curthread->interrupted = intr_save;
_kse_critical_enter();
curthread->sigmask = ucp->uc_sigmask;
+ SIG_CANTMASK(curthread->sigmask);
_kse_critical_leave(&curthread->tcb->tcb_tmbx);
DBG_MSG("<<< _thr_sig_handler(%d)\n", sig);
}
@@ -478,6 +479,7 @@ thr_sig_invoke_handler(struct pthread *curthread, int sig, siginfo_t *info,
* Restore the thread's signal mask.
*/
curthread->sigmask = ucp->uc_sigmask;
+ SIG_CANTMASK(curthread->sigmask);
if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
__sys_sigprocmask(SIG_SETMASK, &ucp->uc_sigmask, NULL);
KSE_SCHED_LOCK(curkse, curkse->k_kseg);
OpenPOWER on IntegriCloud