diff options
author | deischen <deischen@FreeBSD.org> | 2003-06-08 17:37:21 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-06-08 17:37:21 +0000 |
commit | 7a2a53be280c35184a8f114eb0b16ac8c587db99 (patch) | |
tree | ea56eff9a9bda9db0383ae85a60f1f184fdeed9c /lib/libkse/thread | |
parent | 08f5ae21798662f49079405699e6a7a9257175b4 (diff) | |
download | FreeBSD-src-7a2a53be280c35184a8f114eb0b16ac8c587db99.zip FreeBSD-src-7a2a53be280c35184a8f114eb0b16ac8c587db99.tar.gz |
After selecting a thread to handle a signal and taking
its scheduling lock, make sure that the thread still has
the signal unmasked.
Make a debug statement conditional on debugging being
enabled.
Diffstat (limited to 'lib/libkse/thread')
-rw-r--r-- | lib/libkse/thread/thr_sig.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c index 1250a95..b001c7b 100644 --- a/lib/libkse/thread/thr_sig.c +++ b/lib/libkse/thread/thr_sig.c @@ -151,7 +151,7 @@ _thr_sig_dispatch(struct kse *curkse, int sig, siginfo_t *info) /* Some signals need special handling: */ handle_special_signals(curkse, sig); - stderr_debug("dispatch sig:%d\n", sig); + DBG_MSG("dispatch sig:%d\n", sig); while ((thread = thr_sig_find(curkse, sig, info)) != NULL) { /* * Setup the target thread to receive the signal: @@ -163,7 +163,12 @@ _thr_sig_dispatch(struct kse *curkse, int sig, siginfo_t *info) THR_IS_EXITING(thread) || THR_IS_SUSPENDED(thread)) { KSE_SCHED_UNLOCK(curkse, thread->kseg); _thr_ref_delete(NULL, thread); - } else { + } else if (sigismember(&thread->tmbx.tm_context.uc_sigmask, + sig)) { + KSE_SCHED_UNLOCK(curkse, thread->kseg); + _thr_ref_delete(NULL, thread); + } + else { _thr_sig_add(thread, sig, info); KSE_SCHED_UNLOCK(curkse, thread->kseg); _thr_ref_delete(NULL, thread); @@ -894,7 +899,7 @@ thr_sigframe_save(struct pthread *thread, struct pthread_sigframe *psf) { /* This has to initialize all members of the sigframe. */ psf->psf_flags = - thread->flags & (THR_FLAGS_PRIVATE|THR_FLAGS_IN_TDLIST); + thread->flags & (THR_FLAGS_PRIVATE | THR_FLAGS_IN_TDLIST); psf->psf_interrupted = thread->interrupted; psf->psf_signo = thread->signo; psf->psf_state = thread->state; |