diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-09-08 02:18:20 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-09-08 02:18:20 +0000 |
commit | 417820202cd2e37eb1dc50046fc513cbeba94f88 (patch) | |
tree | a188e9ca4948e0dc673cd9a43bff21ba71c96eb2 /lib | |
parent | 6e924b9074b30fda97d34c3d60180a912c8a98ce (diff) | |
download | FreeBSD-src-417820202cd2e37eb1dc50046fc513cbeba94f88.zip FreeBSD-src-417820202cd2e37eb1dc50046fc513cbeba94f88.tar.gz |
To avoid possible race condition, SIGCANCEL is always sent except the
thread is dead.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/thread/thr_cancel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index e408e03..c61cede 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); |