diff options
| author | Jason Evans <jasone@FreeBSD.org> | 2001-05-20 23:08:33 +0000 |
|---|---|---|
| committer | Jason Evans <jasone@FreeBSD.org> | 2001-05-20 23:08:33 +0000 |
| commit | 6699b0c6fe5ba655ac55ea5cba946fdcc0cf228b (patch) | |
| tree | d89bbc87d3018d7cb1234795377d3f0ef34f62c9 /lib/libpthread/thread/thr_cancel.c | |
| parent | 67d1f21cbefeec741ddb15e99369fa92f7a841c5 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_cancel.c')
| -rw-r--r-- | lib/libpthread/thread/thr_cancel.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c index 8b9132ce651d..2af3db6b2c1c 100644 --- a/lib/libpthread/thread/thr_cancel.c +++ b/lib/libpthread/thread/thr_cancel.c @@ -63,6 +63,7 @@ _pthread_cancel(pthread_t pthread) PTHREAD_NEW_STATE(pthread,PS_RUNNING); break; + case PS_JOIN: case PS_SUSPENDED: if (pthread->suspended == SUSP_NO || pthread->suspended == SUSP_YES || @@ -82,7 +83,6 @@ _pthread_cancel(pthread_t pthread) case PS_FDLR_WAIT: case PS_FDLW_WAIT: case PS_FILE_WAIT: - case PS_JOIN: /* * Threads in these states may be in queues. * In order to preserve queue integrity, the @@ -189,6 +189,7 @@ _pthread_testcancel(void) */ curthread->cancelflags &= ~PTHREAD_CANCELLING; _thread_exit_cleanup(); + pthread_detach((pthread_t)curthread); pthread_exit(PTHREAD_CANCELED); PANIC("cancel"); } @@ -225,6 +226,7 @@ finish_cancellation(void *arg) if ((curthread->cancelflags & PTHREAD_CANCEL_NEEDED) != 0) { curthread->cancelflags &= ~PTHREAD_CANCEL_NEEDED; _thread_exit_cleanup(); + pthread_detach((pthread_t)curthread); pthread_exit(PTHREAD_CANCELED); } } |
