From 65770efab0247dbcaa6398b791b891318b36e146 Mon Sep 17 00:00:00 2001
From: Jason Whitehorn <jason.whitehorn@gmail.com>
Date: Sun, 5 Aug 2012 08:22:32 -0500
Subject: [PATCH] calling pthread_join on a detached thread should return
EINVAL
---
src/system/libroot/posix/pthread/pthread.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/system/libroot/posix/pthread/pthread.cpp b/src/system/libroot/posix/pthread/pthread.cpp
index 4c5104a..a6226b5 100644
a
|
b
|
pthread_join(pthread_t thread, void** _value)
|
191 | 191 | |
192 | 192 | if (_value != NULL) |
193 | 193 | *_value = thread->exit_value; |
| 194 | |
| 195 | if( thread->flags & THREAD_DETACHED != 0) |
| 196 | return EINVAL; |
194 | 197 | |
195 | 198 | if ((atomic_or(&thread->flags, THREAD_DETACHED) & THREAD_DEAD) != 0) |
196 | 199 | free(thread); |