mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
Kernel: disown should unblock any potential waiters
This is necessary because if a process changes the state to Stopped or resumes from that state, a wait entry is created in the parent process. So, if a child process does this before disown is called, we need to clear those entries to avoid leaking references/zombies that won't be cleaned up until the former parent exits. This also should solve an even more unlikely corner case where another thread is waiting on a pid that is being disowned by another thread.
This commit is contained in:
@@ -642,6 +642,11 @@ void Process::finalize(Thread& last_thread)
|
||||
m_wait_block_condition.finalize();
|
||||
}
|
||||
|
||||
void Process::disowned_by_waiter(Process& process)
|
||||
{
|
||||
m_wait_block_condition.disowned_by_waiter(process);
|
||||
}
|
||||
|
||||
void Process::unblock_waiters(Thread& thread, Thread::WaitBlocker::UnblockFlags flags, u8 signal)
|
||||
{
|
||||
if (auto parent = Process::from_pid(ppid()))
|
||||
|
||||
Reference in New Issue
Block a user