summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_join.c')
-rw-r--r--lib/libc_r/uthread/uthread_join.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc_r/uthread/uthread_join.c b/lib/libc_r/uthread/uthread_join.c
index 454c79a..0f5e8fc 100644
--- a/lib/libc_r/uthread/uthread_join.c
+++ b/lib/libc_r/uthread/uthread_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
OpenPOWER on IntegriCloud