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:
parent
2a8de4cdec
commit
65cb406327
4 changed files with 18 additions and 33 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue