mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
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.
This commit is contained in:
parent
9e32d79e02
commit
78f1b5e359
10 changed files with 178 additions and 83 deletions
|
@ -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*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue