diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2003-05-16 19:58:30 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2003-05-16 19:58:30 +0000 |
| commit | fd626336fd97bad05a86f02b646c66d2fe14d01a (patch) | |
| tree | b51a83e5c85ef7655ee05174c31348fd86fe4591 /lib/libpthread/thread/thr_join.c | |
| parent | 72a3951459cd8937c6b6f0b43804c39889c4ae30 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_join.c')
| -rw-r--r-- | lib/libpthread/thread/thr_join.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c index 7cbc192fa293..dd69bbbde72d 100644 --- a/lib/libpthread/thread/thr_join.c +++ b/lib/libpthread/thread/thr_join.c @@ -123,13 +123,15 @@ _pthread_join(pthread_t pthread, void **thread_return) THR_SCHED_UNLOCK(curthread, pthread); _thr_ref_delete(curthread, pthread); - THR_LOCK_SWITCH(curthread); + THR_SCHED_LOCK(curthread, curthread); while (curthread->join_status.thread == pthread) { THR_SET_STATE(curthread, PS_JOIN); + THR_SCHED_UNLOCK(curthread, curthread); /* Schedule the next thread: */ _thr_sched_switch(curthread); + THR_SCHED_LOCK(curthread, curthread); } - THR_UNLOCK_SWITCH(curthread); + THR_SCHED_UNLOCK(curthread, curthread); /* * The thread return value and error are set by the |
