diff options
author | Tom <tomut@yahoo.com> | 2020-09-15 13:53:15 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-15 23:30:44 +0200 |
commit | e31f8b56e8141c3369cb4b23ee3d33151b89e420 (patch) | |
tree | 96d24ecb4ac60f5120244fd683a3c86239cff066 /Kernel/Scheduler.h | |
parent | f6d1e45bf33b4e1e860f80d5176a2a38614880eb (diff) | |
download | serenity-e31f8b56e8141c3369cb4b23ee3d33151b89e420.zip |
Kernel: Fix thread donation hanging the system
Fixes two flaws in the thread donation logic: Scheduler::donate_to
would never really donate, but just trigger a deferred yield. And
that deferred yield never actually donated to the beneficiary.
So, when we can't immediately donate, we need to save the beneficiary
and use this information as soon as we can perform the deferred
context switch.
Fixes #3495
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 cfe2892c25..e4b2184ce5 100644 --- a/Kernel/Scheduler.h +++ b/Kernel/Scheduler.h @@ -59,6 +59,7 @@ public: static bool pick_next(); static timeval time_since_boot(); static bool yield(); + static bool donate_to_and_switch(Thread*, const char* reason); static bool donate_to(Thread*, const char* reason); static bool context_switch(Thread*); static void enter_current(Thread& prev_thread); |