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:
@@ -189,7 +189,11 @@ int
|
|||||||
pthread_join(pthread_t thread, void** _value)
|
pthread_join(pthread_t thread, void** _value)
|
||||||
{
|
{
|
||||||
status_t dummy;
|
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)
|
if (error == B_BAD_THREAD_ID)
|
||||||
RETURN_AND_TEST_CANCEL(ESRCH);
|
RETURN_AND_TEST_CANCEL(ESRCH);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user