From 58dd7bbd1627ed4a3536e34c49fdda9c3a7ea0ab Mon Sep 17 00:00:00 2001
From: Jason Whitehorn <jason.whitehorn@gmail.com>
Date: Sat, 4 Aug 2012 20:11:24 -0500
Subject: [PATCH 2/2] 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..71e5eca 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) |
| 196 | return EINVAL;; |
194 | 197 | |
195 | 198 | if ((atomic_or(&thread->flags, THREAD_DETACHED) & THREAD_DEAD) != 0) |
196 | 199 | free(thread); |