1 | diff --git a/src/system/libroot/posix/pthread/pthread.cpp b/src/system/libroot/posix/pthread/pthread.cpp
|
---|
2 | index 4c5104a..71e5eca 100644
|
---|
3 | --- a/src/system/libroot/posix/pthread/pthread.cpp
|
---|
4 | +++ b/src/system/libroot/posix/pthread/pthread.cpp
|
---|
5 | @@ -191,6 +191,9 @@ pthread_join(pthread_t thread, void** _value)
|
---|
6 |
|
---|
7 | if (_value != NULL)
|
---|
8 | *_value = thread->exit_value;
|
---|
9 | +
|
---|
10 | + if(thread->flags & THREAD_DETACHED)
|
---|
11 | + return EINVAL;;
|
---|
12 |
|
---|
13 | if ((atomic_or(&thread->flags, THREAD_DETACHED) & THREAD_DEAD) != 0)
|
---|
14 | free(thread);
|
---|