From 9bfd728d16cc9463c1c5afc15f04d1d218fcc103 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 26 Jun 2013 05:49:29 +0000 Subject: [PATCH] MFC r251985: When enabling the cancellation, only process the pending cancellation for asynchronous mode. git-svn-id: svn://svn.freebsd.org/base/stable/9@252245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libthr/thread/thr_cancel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index 89f0ee14e..beae707ca 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); -- 2.45.0