summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_sig.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2008-03-18 02:06:51 +0000
committerdavidxu <davidxu@FreeBSD.org>2008-03-18 02:06:51 +0000
commit9dbfb036ab5c3c3ecedf1ba5ad7e5904492b6f49 (patch)
tree0f199def54ed0bbe7382f19b627a69e5a17b5e54 /lib/libthr/thread/thr_sig.c
parent965a19847a23893c3eed9b5702a142e657fc79b3 (diff)
downloadFreeBSD-src-9dbfb036ab5c3c3ecedf1ba5ad7e5904492b6f49.zip
FreeBSD-src-9dbfb036ab5c3c3ecedf1ba5ad7e5904492b6f49.tar.gz
- Copy signal mask out before THR_UNLOCK(), because THR_UNLOCK() may call
_thr_suspend_check() which messes sigmask saved in thread structure. - Don't suspend a thread has force_exit set. - In pthread_exit(), if there is a suspension flag set, wake up waiting- thread after setting PS_DEAD, this causes waiting-thread to break loop in suspend_common().
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-rw-r--r--lib/libthr/thread/thr_sig.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index 5d89d7f..fe1555a 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -92,6 +92,9 @@ _thr_suspend_check(struct pthread *curthread)
long cycle;
int err;
+ if (curthread->force_exit)
+ return;
+
err = errno;
/*
* Blocks SIGCANCEL which other threads must send.
OpenPOWER on IntegriCloud