From 17dce7e108d6446f8aeda58eb8d48642c86d9802 Mon Sep 17 00:00:00 2001 From: David Xu Date: Wed, 8 Sep 2010 02:18:20 +0000 Subject: To avoid possible race condition, SIGCANCEL is always sent except the thread is dead. --- lib/libthr/thread/thr_cancel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3