wait_for_child() does now wait for the main thread of a dead child to be

gone. Fixes bug #1639.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25568 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-19 23:21:58 +00:00
parent 4e9ac4d14e
commit 0a89fae916

View File

@ -1940,6 +1940,12 @@ wait_for_child(pid_t child, uint32 flags, int32 *_reason,
atomic_and(&thread->sig_pending, ~SIGNAL_TO_MASK(SIGCHLD));
}
// When the team is dead, the main thread continues to live in the kernel
// team for a very short time. To avoid surprises for the caller we rather
// wait until the thread is really gone.
if (foundEntry.state == JOB_CONTROL_STATE_DEAD)
wait_for_thread(foundEntry.thread, NULL);
T(WaitForChildDone(foundEntry));
return foundEntry.thread;