diff options
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_cancel.c | 4 | ||||
-rw-r--r-- | lib/libthr/thread/thr_fork.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_private.h | 1 |
3 files changed, 3 insertions, 5 deletions
diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index 6a6e9ec..8552e57 100644 --- a/lib/libthr/thread/thr_cancel.c +++ b/lib/libthr/thread/thr_cancel.c @@ -131,9 +131,7 @@ _pthread_testcancel(void) { struct pthread *curthread = _get_curthread(); - curthread->cancel_point = 1; testcancel(curthread); - curthread->cancel_point = 0; } void @@ -159,7 +157,7 @@ _thr_cancel_enter2(struct pthread *curthread, int maycancel) void _thr_cancel_leave(struct pthread *curthread, int maycancel) { + curthread->cancel_point = 0; if (maycancel) testcancel(curthread); - curthread->cancel_point = 0; } diff --git a/lib/libthr/thread/thr_fork.c b/lib/libthr/thread/thr_fork.c index fb5daa1..a1399bf 100644 --- a/lib/libthr/thread/thr_fork.c +++ b/lib/libthr/thread/thr_fork.c @@ -248,7 +248,8 @@ _fork(void) _thr_rwlock_unlock(&_thr_atfork_lock); curthread->no_cancel = cancelsave; /* test async cancel */ - _thr_testcancel(curthread); + if (curthread->cancel_async) + _thr_testcancel(curthread); } errno = errsave; diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index 8b545e5..a42b4ec 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -357,7 +357,6 @@ struct pthread { #define SHOULD_CANCEL(thr) \ ((thr)->cancel_pending && (thr)->cancel_enable && \ - ((thr)->cancel_point || (thr)->cancel_async) && \ (thr)->no_cancel == 0) /* Cancellation is enabled */ |