mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
Kernel: The exit_thread() syscall should unlock the big lock.
Since exit_thread() never returns, it can't rely on the syscall trap handler to unlock the big lock before returning.
This commit is contained in:
@@ -2445,12 +2445,13 @@ int Process::sys$create_thread(int(*entry)(void*), void* argument)
|
||||
|
||||
void Process::sys$exit_thread(int code)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
cli();
|
||||
if (¤t->process().main_thread() == current) {
|
||||
sys$exit(code);
|
||||
return;
|
||||
}
|
||||
current->set_state(Thread::State::Dying);
|
||||
big_lock().unlock_if_locked();
|
||||
Scheduler::pick_next_and_switch_now();
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user