diff options
| author | Archie Cobbs <archie@FreeBSD.org> | 2002-05-02 19:57:59 +0000 |
|---|---|---|
| committer | Archie Cobbs <archie@FreeBSD.org> | 2002-05-02 19:57:59 +0000 |
| commit | ca0989d865a1207e0deae0ef3739b462e21018de (patch) | |
| tree | 939a938406d390131d2f8df08d80d12ee8cfd54a /lib/libkse | |
| parent | 1de6d677914279e9e617a509a221758fab323e65 (diff) | |
Notes
Diffstat (limited to 'lib/libkse')
| -rw-r--r-- | lib/libkse/thread/thr_cancel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_cancel.c b/lib/libkse/thread/thr_cancel.c index cf72d89e908be..b6b070f0549d2 100644 --- a/lib/libkse/thread/thr_cancel.c +++ b/lib/libkse/thread/thr_cancel.c @@ -20,7 +20,8 @@ _pthread_cancel(pthread_t pthread) if ((ret = _find_thread(pthread)) != 0) { /* NOTHING */ - } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK) { + } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK + || (pthread->flags & PTHREAD_EXITING) != 0) { ret = 0; } else { /* Protect the scheduling queues: */ @@ -194,7 +195,8 @@ _pthread_testcancel(void) struct pthread *curthread = _get_curthread(); if (((curthread->cancelflags & PTHREAD_CANCEL_DISABLE) == 0) && - ((curthread->cancelflags & PTHREAD_CANCELLING) != 0)) { + ((curthread->cancelflags & PTHREAD_CANCELLING) != 0) && + ((curthread->flags & PTHREAD_EXITING) == 0)) { /* * It is possible for this thread to be swapped out * while performing cancellation; do not allow it |
