mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 12:27:35 +00:00
Kernel: Fix a few deadlocks with Thread::m_lock and g_scheduler_lock
g_scheduler_lock cannot safely be acquired after Thread::m_lock because another processor may already hold g_scheduler_lock and wait for the same Thread::m_lock.
This commit is contained in:
parent
8c764319ad
commit
1e2e3eed62
6 changed files with 55 additions and 37 deletions
|
@ -308,7 +308,10 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
|
|||
if (was_profiling)
|
||||
Profiling::did_exec(path);
|
||||
|
||||
new_main_thread->set_state(Thread::State::Runnable);
|
||||
{
|
||||
ScopedSpinLock lock(g_scheduler_lock);
|
||||
new_main_thread->set_state(Thread::State::Runnable);
|
||||
}
|
||||
big_lock().force_unlock_if_locked();
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
ASSERT(Processor::current().in_critical());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue