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
This commit is contained in:
Konstantin Belousov 2013-06-19 04:47:41 +00:00
parent 0963c8e431
commit a0b9cbc8a2

View File

@ -87,7 +87,8 @@ _pthread_setcancelstate(int state, int *oldstate)
break;
case PTHREAD_CANCEL_ENABLE:
curthread->cancel_enable = 1;
testcancel(curthread);
if (curthread->cancel_async)
testcancel(curthread);
break;
default:
return (EINVAL);