diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2003-05-24 02:29:25 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2003-05-24 02:29:25 +0000 |
| commit | 1cb570c53190e8b569091f708781c6bf9c3126c7 (patch) | |
| tree | e99d3167d044ff37cf6b26fa4f4fe83140c8af79 /lib/libpthread/thread/thr_join.c | |
| parent | a224a3919d4b2260bb1d91fb7f848de673444c26 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_join.c')
| -rw-r--r-- | lib/libpthread/thread/thr_join.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c index dd69bbbde72d..d6add8889ef0 100644 --- a/lib/libpthread/thread/thr_join.c +++ b/lib/libpthread/thread/thr_join.c @@ -133,6 +133,17 @@ _pthread_join(pthread_t pthread, void **thread_return) } THR_SCHED_UNLOCK(curthread, curthread); + if ((curthread->cancelflags & THR_CANCELLING) && + !(curthread->cancelflags & PTHREAD_CANCEL_DISABLE)) { + if (_thr_ref_add(curthread, pthread, 1) == 0) { + THR_SCHED_LOCK(curthread, pthread); + pthread->joiner = NULL; + THR_SCHED_UNLOCK(curthread, pthread); + _thr_ref_delete(curthread, pthread); + } + pthread_exit(PTHREAD_CANCELED); + } + /* * The thread return value and error are set by the * thread we're joining to when it exits or detaches: |
