Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2013 04:47:41 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251985 - head/lib/libthr/thread
Message-ID:  <201306190447.r5J4lfTb061110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jun 19 04:47:41 2013
New Revision: 251985
URL: http://svnweb.freebsd.org/changeset/base/251985

Log:
  The SUSv4tc1 requires that pthread_setcancelstate() shall be not a
  cancellation point.  When enabling the cancellation, only process the
  pending cancellation for asynchronous mode.
  
  Reported and reviewed by:	Kohji Okuno <okuno.kohji@jp.panasonic.com>
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

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

Modified: head/lib/libthr/thread/thr_cancel.c
==============================================================================
--- head/lib/libthr/thread/thr_cancel.c	Wed Jun 19 03:08:01 2013	(r251984)
+++ head/lib/libthr/thread/thr_cancel.c	Wed Jun 19 04:47:41 2013	(r251985)
@@ -87,7 +87,8 @@ _pthread_setcancelstate(int state, int *
 		break;
 	case PTHREAD_CANCEL_ENABLE:
 		curthread->cancel_enable = 1;
-		testcancel(curthread);
+		if (curthread->cancel_async)
+			testcancel(curthread);
 		break;
 	default:
 		return (EINVAL);



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