summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-06-19 04:47:41 +0000
committerkib <kib@FreeBSD.org>2013-06-19 04:47:41 +0000
commit6d092fb00e8c500be4b52ae70080e363f935e137 (patch)
treeebc866de81a3bb11bec6018637378095b96ea476 /lib/libthr
parenta203bbbf37f6842eb1ac5cf7d21546fef7a4af67 (diff)
downloadFreeBSD-src-6d092fb00e8c500be4b52ae70080e363f935e137.zip
FreeBSD-src-6d092fb00e8c500be4b52ae70080e363f935e137.tar.gz
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
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_cancel.c3
1 files changed, 2 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud