aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-09-08 02:18:20 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-09-08 02:18:20 +0000
commit17dce7e108d6446f8aeda58eb8d48642c86d9802 (patch)
treea188e9ca4948e0dc673cd9a43bff21ba71c96eb2 /lib
parent4982c539ae5f561ef3ad34af5938929f8548db63 (diff)
downloadsrc-17dce7e108d6446f8aeda58eb8d48642c86d9802.tar.gz
src-17dce7e108d6446f8aeda58eb8d48642c86d9802.zip
To avoid possible race condition, SIGCANCEL is always sent except the
thread is dead.
Notes
Notes: svn path=/head/; revision=212312
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_cancel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c
index e408e03dbcd4..c61cedeeac35 100644
--- a/lib/libthr/thread/thr_cancel.c
+++ b/lib/libthr/thread/thr_cancel.c
@@ -67,7 +67,7 @@ _pthread_cancel(pthread_t pthread)
THR_THREAD_LOCK(curthread, pthread);
if (!pthread->cancel_pending) {
pthread->cancel_pending = 1;
- if (pthread->cancel_enable)
+ if (pthread->state != PS_DEAD)
_thr_send_sig(pthread, SIGCANCEL);
}
THR_THREAD_UNLOCK(curthread, pthread);