summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_join.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2001-11-17 14:28:39 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2001-11-17 14:28:39 +0000
commitccc7b69205d48bc890a1565811ef265a7904977c (patch)
treed9b490926b6ae401659e2052a1b89c5bea09c6d4 /lib/libpthread/thread/thr_join.c
parent608f31f640fa809e3d3f91a58b0bcbe10e125267 (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_join.c')
-rw-r--r--lib/libpthread/thread/thr_join.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libpthread/thread/thr_join.c b/lib/libpthread/thread/thr_join.c
index 454c79a924f9..0f5e8fc5c1ed 100644
--- a/lib/libpthread/thread/thr_join.c
+++ b/lib/libpthread/thread/thr_join.c
@@ -122,18 +122,20 @@ _pthread_join(pthread_t pthread, void **thread_return)
pthread->joiner = curthread;
/* Keep track of which thread we're joining to: */
- curthread->data.thread = pthread;
+ curthread->join_status.thread = pthread;
- /* Schedule the next thread: */
- _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);
+ while (curthread->join_status.thread == pthread) {
+ /* Schedule the next thread: */
+ _thread_kern_sched_state(PS_JOIN, __FILE__, __LINE__);
+ }
/*
* The thread return value and error are set by the thread we're
* joining to when it exits or detaches:
*/
- ret = curthread->error;
+ ret = curthread->join_status.error;
if ((ret == 0) && (thread_return != NULL))
- *thread_return = curthread->ret;
+ *thread_return = curthread->join_status.ret;
} else {
/*
* The thread exited (is dead) without being detached, and no