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:
parent
80850e274d
commit
14ac77131b
Notes:
sideshowbarker
2024-07-19 14:32:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/14ac77131b8
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue