1
0
Fork 0
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:
Tom 2020-09-15 13:53:15 -06:00 committed by Andreas Kling
parent f6d1e45bf3
commit e31f8b56e8
Notes: sideshowbarker 2024-07-19 02:23:26 +09:00
2 changed files with 85 additions and 29 deletions

View file

@ -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);