pthread_join: Retry when interrupted as mandated by POSIX.

The spec explicitly states that pthread_join shall not return EINTR, so
we have to retry the wait when it gets interrupted instead of letting
the error code through.
This commit is contained in:
Michael Lotz
2013-12-07 14:15:05 +00:00
parent 03765c1d99
commit 57d8dd92ef
+5 -1
View File
@@ -189,7 +189,11 @@ int
pthread_join(pthread_t thread, void** _value)
{
status_t dummy;
status_t error = wait_for_thread(thread->id, &dummy);
status_t error;
do {
error = wait_for_thread(thread->id, &dummy);
} while (error == B_INTERRUPTED);
if (error == B_BAD_THREAD_ID)
RETURN_AND_TEST_CANCEL(ESRCH);