Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Aug 2010 02:50:12 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211409 - head/lib/libthr/thread
Message-ID:  <201008170250.o7H2oCa8016462@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008170250.o7H2oCa8016462>