aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_detach.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_detach.c')
-rw-r--r--lib/libpthread/thread/thr_detach.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c
index 89cc6671179c..3bade9d5b244 100644
--- a/lib/libpthread/thread/thr_detach.c
+++ b/lib/libpthread/thread/thr_detach.c
@@ -61,9 +61,10 @@ pthread_detach(pthread_t pthread)
/* Enter a loop to bring all threads off the join queue: */
while ((next_thread = TAILQ_FIRST(&pthread->join_queue)) != NULL) {
/* Remove the thread from the queue: */
- TAILQ_REMOVE(&pthread->join_queue, next_thread, qe);
+ TAILQ_REMOVE(&pthread->join_queue, next_thread, sqe);
+ pthread->flags &= ~PTHREAD_FLAGS_IN_JOINQ;
- /* Make the thread run: */
+ /* Make the thread runnable: */
PTHREAD_NEW_STATE(next_thread,PS_RUNNING);
}