diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index 89f0ee14e635..beae707cacdc 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);