diff options
author | Tom <tomut@yahoo.com> | 2020-11-30 19:04:36 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-01 09:48:34 +0100 |
commit | 78f1b5e359f1436f90d1c54929be30c0e41d8df0 (patch) | |
tree | 439c4da3f7c26779775ebb2a2150141f67330d53 /Kernel/Scheduler.h | |
parent | 9e32d79e02c84c0130c9fe1b143b445ac9093079 (diff) | |
download | serenity-78f1b5e359f1436f90d1c54929be30c0e41d8df0.zip |
Kernel: Fix some problems with Thread::wait_on and Lock
This changes the Thread::wait_on function to not enable interrupts
upon leaving, which caused some problems with page fault handlers
and in other situations. It may now be called from critical
sections, with interrupts enabled or disabled, and returns to the
same state.
This also requires some fixes to Lock. To aid debugging, a new
define LOCK_DEBUG is added that enables checking for Lock leaks
upon finalization of a Thread.
Diffstat (limited to 'Kernel/Scheduler.h')
-rw-r--r-- | Kernel/Scheduler.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Scheduler.h b/Kernel/Scheduler.h index c26fe3ac7e..55a05ddc6c 100644 --- a/Kernel/Scheduler.h +++ b/Kernel/Scheduler.h @@ -57,6 +57,7 @@ public: [[noreturn]] static void start(); static bool pick_next(); static bool yield(); + static void yield_from_critical(); static bool donate_to_and_switch(Thread*, const char* reason); static bool donate_to(RefPtr<Thread>&, const char* reason); static bool context_switch(Thread*); |