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:
Andreas Kling 2019-04-29 15:56:25 +02:00
parent 80850e274d
commit 14ac77131b
Notes: sideshowbarker 2024-07-19 14:32:37 +09:00

View file

@ -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 (&current->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();
}