summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-06-08 17:37:21 +0000
committerdeischen <deischen@FreeBSD.org>2003-06-08 17:37:21 +0000
commit7a2a53be280c35184a8f114eb0b16ac8c587db99 (patch)
treeea56eff9a9bda9db0383ae85a60f1f184fdeed9c /lib/libpthread
parent08f5ae21798662f49079405699e6a7a9257175b4 (diff)
downloadFreeBSD-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/libpthread')
-rw-r--r--lib/libpthread/thread/thr_sig.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index 1250a95..b001c7b 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/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;
OpenPOWER on IntegriCloud