svn commit: r212312 - head/lib/libthr/thread

David Xu davidxu at FreeBSD.org
Wed Sep 8 02:18:21 UTC 2010


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);


More information about the svn-src-all mailing list