svn commit: r211409 - head/lib/libthr/thread
David Xu
davidxu at FreeBSD.org
Tue Aug 17 02:50:13 UTC 2010
Author: davidxu
Date: Tue Aug 17 02:50:12 2010
New Revision: 211409
URL: http://svn.freebsd.org/changeset/base/211409
Log:
Tweak code a bit to be POSIX compatible, when a cancellation request
is acted upon, or when a thread calls pthread_exit(), the thread first
disables cancellation by setting its cancelability state to
PTHREAD_CANCEL_DISABLE and its cancelability type to
PTHREAD_CANCEL_DEFERRED. The cancelability state remains set to
PTHREAD_CANCEL_DISABLE until the thread has terminated.
It has no effect if a cancellation cleanup handler or thread-specific
data destructor routine changes the cancelability state to
PTHREAD_CANCEL_ENABLE.
Modified:
head/lib/libthr/thread/thr_exit.c
Modified: head/lib/libthr/thread/thr_exit.c
==============================================================================
--- head/lib/libthr/thread/thr_exit.c Mon Aug 16 22:23:19 2010 (r211408)
+++ head/lib/libthr/thread/thr_exit.c Tue Aug 17 02:50:12 2010 (r211409)
@@ -81,6 +81,8 @@ _pthread_exit(void *status)
/* Flag this thread as exiting. */
curthread->cancelling = 1;
+ curthread->cancel_enable = 0;
+ curthread->cancel_async = 0;
_thr_exit_cleanup();
More information about the svn-src-all
mailing list