mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
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
This commit is contained in:
parent
f6d1e45bf3
commit
e31f8b56e8
Notes:
sideshowbarker
2024-07-19 02:23:26 +09:00
Author: https://github.com/tomuta
Commit: e31f8b56e8
Pull-request: https://github.com/SerenityOS/serenity/pull/3501
Issue: https://github.com/SerenityOS/serenity/issues/3495
2 changed files with 85 additions and 29 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue