summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_detach.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_detach.c')
-rw-r--r--lib/libc_r/uthread/uthread_detach.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_detach.c b/lib/libc_r/uthread/uthread_detach.c
index 3bade9d..6dd762a 100644
--- a/lib/libc_r/uthread/uthread_detach.c
+++ b/lib/libc_r/uthread/uthread_detach.c
@@ -65,7 +65,12 @@ pthread_detach(pthread_t pthread)
pthread->flags &= ~PTHREAD_FLAGS_IN_JOINQ;
/* Make the thread runnable: */
- PTHREAD_NEW_STATE(next_thread,PS_RUNNING);
+ PTHREAD_NEW_STATE(next_thread, PS_RUNNING);
+
+ /*
+ * Set the return value for the woken thread:
+ */
+ next_thread->error = ESRCH;
}
/*
OpenPOWER on IntegriCloud