mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
Kernel: Always return from Thread::wait_on
We need to always return from Thread::wait_on, even when a thread is being killed. This is necessary so that the kernel call stack can clean up and release references held by it. Then, right before transitioning back to user mode, we check if the thread is supposed to die, and at that point change the thread state to Dying to prevent further scheduling of this thread. This addresses some possible resource leaks similar to #3073
This commit is contained in:
@@ -273,10 +273,6 @@ void Process::kill_threads_except_self()
|
||||
// At this point, we have no joiner anymore
|
||||
thread.m_joiner = nullptr;
|
||||
thread.set_should_die();
|
||||
|
||||
if (thread.state() != Thread::State::Dead)
|
||||
thread.set_state(Thread::State::Dying);
|
||||
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user