summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-07-09 22:30:55 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-07-09 22:30:55 +0000
commit93d7f2a88079601803f360f55a7755528cbc07c4 (patch)
treeb3855590053188ea68b6e4b90ab96eac040dc9ad
parent97cc223e64dd27da7f5c153874b18c1955b78976 (diff)
downloadFreeBSD-src-93d7f2a88079601803f360f55a7755528cbc07c4.zip
FreeBSD-src-93d7f2a88079601803f360f55a7755528cbc07c4.tar.gz
Don't resume sigwait thread If signal is masked.
-rw-r--r--lib/libkse/thread/thr_sig.c20
-rw-r--r--lib/libpthread/thread/thr_sig.c20
2 files changed, 24 insertions, 16 deletions
diff --git a/lib/libkse/thread/thr_sig.c b/lib/libkse/thread/thr_sig.c
index cef8399..556c0b0 100644
--- a/lib/libkse/thread/thr_sig.c
+++ b/lib/libkse/thread/thr_sig.c
@@ -770,10 +770,12 @@ _thr_sig_add(struct pthread *pthread, int sig, siginfo_t *info)
} else {
/* Increment the pending signal count. */
SIGADDSET(pthread->sigpend, sig);
- pthread->check_pending = 1;
- pthread->interrupted = 1;
- pthread->sigmask = pthread->oldsigmask;
- _thr_setrunnable_unlocked(pthread);
+ if (!SIGISMEMBER(pthread->oldsigmask, sig)) {
+ pthread->check_pending = 1;
+ pthread->interrupted = 1;
+ pthread->sigmask = pthread->oldsigmask;
+ _thr_setrunnable_unlocked(pthread);
+ }
}
return;
@@ -836,10 +838,12 @@ thr_sig_check_state(struct pthread *pthread, int sig)
} else {
/* Increment the pending signal count. */
SIGADDSET(pthread->sigpend, sig);
- pthread->check_pending = 1;
- pthread->interrupted = 1;
- pthread->sigmask = pthread->oldsigmask;
- _thr_setrunnable_unlocked(pthread);
+ if (!SIGISMEMBER(pthread->oldsigmask, sig)) {
+ pthread->check_pending = 1;
+ pthread->interrupted = 1;
+ pthread->sigmask = pthread->oldsigmask;
+ _thr_setrunnable_unlocked(pthread);
+ }
}
break;
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index cef8399..556c0b0 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -770,10 +770,12 @@ _thr_sig_add(struct pthread *pthread, int sig, siginfo_t *info)
} else {
/* Increment the pending signal count. */
SIGADDSET(pthread->sigpend, sig);
- pthread->check_pending = 1;
- pthread->interrupted = 1;
- pthread->sigmask = pthread->oldsigmask;
- _thr_setrunnable_unlocked(pthread);
+ if (!SIGISMEMBER(pthread->oldsigmask, sig)) {
+ pthread->check_pending = 1;
+ pthread->interrupted = 1;
+ pthread->sigmask = pthread->oldsigmask;
+ _thr_setrunnable_unlocked(pthread);
+ }
}
return;
@@ -836,10 +838,12 @@ thr_sig_check_state(struct pthread *pthread, int sig)
} else {
/* Increment the pending signal count. */
SIGADDSET(pthread->sigpend, sig);
- pthread->check_pending = 1;
- pthread->interrupted = 1;
- pthread->sigmask = pthread->oldsigmask;
- _thr_setrunnable_unlocked(pthread);
+ if (!SIGISMEMBER(pthread->oldsigmask, sig)) {
+ pthread->check_pending = 1;
+ pthread->interrupted = 1;
+ pthread->sigmask = pthread->oldsigmask;
+ _thr_setrunnable_unlocked(pthread);
+ }
}
break;
OpenPOWER on IntegriCloud