forked from Bananymous/banan-os
Kernel: Fix process exiting infinite loop
If process was exiting and had a process waiting for it and that waiting process got interrupted, the exiting process could never exit.
This commit is contained in:
parent
3ab1214012
commit
974b9b992d
|
@ -566,7 +566,13 @@ namespace Kernel
|
|||
return BAN::Error::from_errno(ECHILD);
|
||||
|
||||
while (!target->m_exit_status.exited)
|
||||
TRY(Thread::current().block_or_eintr_indefinite(target->m_exit_status.semaphore));
|
||||
{
|
||||
if (auto ret = Thread::current().block_or_eintr_indefinite(target->m_exit_status.thread_blocker); ret.is_error())
|
||||
{
|
||||
target->m_exit_status.waiting--;
|
||||
return ret.release_error();
|
||||
}
|
||||
}
|
||||
|
||||
int exit_status = target->m_exit_status.exit_code;
|
||||
target->m_exit_status.waiting--;
|
||||
|
|
Loading…
Reference in New Issue