Author: davidxu
Date: Wed Sep  8 02:18:20 2010
New Revision: 212312
URL: http://svn.freebsd.org/changeset/base/212312

Log:
  To avoid possible race condition, SIGCANCEL is always sent except the
  thread is dead.

Modified:
  head/lib/libthr/thread/thr_cancel.c

Modified: head/lib/libthr/thread/thr_cancel.c
==============================================================================
--- head/lib/libthr/thread/thr_cancel.c Wed Sep  8 01:55:03 2010        
(r212311)
+++ head/lib/libthr/thread/thr_cancel.c Wed Sep  8 02:18:20 2010        
(r212312)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to