diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2003-07-23 02:11:07 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2003-07-23 02:11:07 +0000 |
| commit | cc24e836059e12193a1dfb766c7ba78fcd905875 (patch) | |
| tree | 2ba938226cb9f3c751737df74c5cdf8e63cf8eba /lib/libpthread/thread/thr_detach.c | |
| parent | a33f5caff3ff006549d1334173f4c798239368e5 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_detach.c')
| -rw-r--r-- | lib/libpthread/thread/thr_detach.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c index 0b63dac190b0..0159e531758c 100644 --- a/lib/libpthread/thread/thr_detach.c +++ b/lib/libpthread/thread/thr_detach.c @@ -43,6 +43,7 @@ int _pthread_detach(pthread_t pthread) { struct pthread *curthread = _get_curthread(); + struct kse_mailbox *kmbx = NULL; struct pthread *joiner; int rval = 0; @@ -83,12 +84,11 @@ _pthread_detach(pthread_t pthread) joiner->join_status.ret = NULL; joiner->join_status.thread = NULL; - _thr_setrunnable_unlocked(joiner); + kmbx = _thr_setrunnable_unlocked(joiner); } joiner = NULL; } THR_SCHED_UNLOCK(curthread, pthread); - /* See if there is a thread waiting in pthread_join(): */ if ((joiner != NULL) && (_thr_ref_add(curthread, joiner, 0) == 0)) { @@ -102,12 +102,14 @@ _pthread_detach(pthread_t pthread) joiner->join_status.ret = NULL; joiner->join_status.thread = NULL; - _thr_setrunnable_unlocked(joiner); + kmbx = _thr_setrunnable_unlocked(joiner); } THR_SCHED_UNLOCK(curthread, joiner); _thr_ref_delete(curthread, joiner); } _thr_ref_delete(curthread, pthread); + if (kmbx != NULL) + kse_wakeup(kmbx); } /* Return the completion status: */ |
