1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 04:07:35 +00:00

Kernel: Allow unlocking a held Lock with interrupts disabled

This is needed to eliminate a race in Thread::wait_on() where we'd
otherwise have to wait until after unlocking the process lock before
we can disable interrupts.
This commit is contained in:
Andreas Kling 2020-01-12 22:53:20 +01:00
parent 2a8de4cdec
commit 65cb406327
4 changed files with 18 additions and 33 deletions

View file

@ -888,7 +888,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
#endif
new_main_thread->set_state(Thread::State::Skip1SchedulerPass);
big_lock().unlock_if_locked();
big_lock().force_unlock_if_locked();
return 0;
}
@ -3622,7 +3622,7 @@ void Process::sys$exit_thread(void* exit_value)
cli();
current->m_exit_value = exit_value;
current->set_should_die();
big_lock().unlock_if_locked();
big_lock().force_unlock_if_locked();
current->die_if_needed();
ASSERT_NOT_REACHED();
}