diff options
author | kib <kib@FreeBSD.org> | 2013-06-19 04:47:41 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-06-19 04:47:41 +0000 |
commit | 6d092fb00e8c500be4b52ae70080e363f935e137 (patch) | |
tree | ebc866de81a3bb11bec6018637378095b96ea476 /lib/libthr | |
parent | a203bbbf37f6842eb1ac5cf7d21546fef7a4af67 (diff) | |
download | FreeBSD-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.c | 3 |
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); |