summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-09-15 13:53:15 -0600
committerAndreas Kling <kling@serenityos.org>2020-09-15 23:30:44 +0200
commite31f8b56e8141c3369cb4b23ee3d33151b89e420 (patch)
tree96d24ecb4ac60f5120244fd683a3c86239cff066 /Kernel/Scheduler.h
parentf6d1e45bf33b4e1e860f80d5176a2a38614880eb (diff)
downloadserenity-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.h1
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);