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

Kernel: Prevent recursive calls into the scheduler

Upon leaving a critical section (such as a SpinLock) we need to
check if we're already asynchronously invoking the Scheduler.
Otherwise we might end up triggering another context switch
as soon as leaving the scheduler lock.

Fixes #2883
This commit is contained in:
Tom 2020-08-01 14:37:40 -06:00 committed by Andreas Kling
parent a19304c9d6
commit 728de56481
5 changed files with 136 additions and 21 deletions

View file

@ -62,6 +62,9 @@ public:
static bool donate_to(Thread*, const char* reason);
static bool context_switch(Thread*);
static void enter_current(Thread& prev_thread);
static void leave_on_first_switch(u32 flags);
static void prepare_after_exec();
static void prepare_for_idle_loop();
static Process* colonel();
static void beep();
static void idle_loop();