mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
Kernel: Release the big process lock while yielding in sys$yield()
Otherwise, a thread calling sched_yield() will prevent other threads in that process from entering the kernel.
This commit is contained in:
@@ -171,12 +171,8 @@ void Thread::die_if_needed()
|
||||
Scheduler::pick_next_and_switch_now();
|
||||
}
|
||||
|
||||
void Thread::block_helper()
|
||||
void Thread::yield_without_holding_big_lock()
|
||||
{
|
||||
// This function mostly exists to avoid circular header dependencies. If
|
||||
// anything needs adding, think carefully about whether it belongs in
|
||||
// block() instead. Remember that we're unlocking here, so be very careful
|
||||
// about altering any state once we're unlocked!
|
||||
bool did_unlock = process().big_lock().unlock_if_locked();
|
||||
Scheduler::yield();
|
||||
if (did_unlock)
|
||||
|
||||
Reference in New Issue
Block a user