From 6d092fb00e8c500be4b52ae70080e363f935e137 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 19 Jun 2013 04:47:41 +0000 Subject: 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 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_cancel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index 89f0ee1..beae707 100644 --- a/lib/libthr/thread/thr_cancel.c +++ b/lib/libthr/thread/thr_cancel.c @@ -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); -- cgit v1.1