mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Unlock the Process when exit()ing
If there are more threads in a process when exit()ing, we need to give them a chance to unwind any kernel stacks. This means we have to unlock the process lock before giving control to the scheduler. Fixes #891 (together with all of the other "no more main thread" work.)
This commit is contained in:
parent
f4978b2be1
commit
523fd6533e
Notes:
sideshowbarker
2024-07-19 10:46:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/523fd6533e0
1 changed files with 3 additions and 0 deletions
|
@ -178,8 +178,11 @@ void Thread::die_if_needed()
|
|||
if (!m_should_die)
|
||||
return;
|
||||
|
||||
m_process.big_lock().unlock_if_locked();
|
||||
|
||||
InterruptDisabler disabler;
|
||||
set_state(Thread::State::Dying);
|
||||
|
||||
if (!Scheduler::is_active())
|
||||
Scheduler::pick_next_and_switch_now();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue