1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 10:01:13 +09:00

Kernel: Enhance WaitQueue to remember pending wakes

If WaitQueue::wake_all, WaitQueue::wake_one, or WaitQueue::wake_n
is called but nobody is currently waiting, we should remember that
fact and prevent someone from waiting after such a request. This
solves a race condition where the Finalizer thread is notified
to finalize a thread, but it is not (yet) waiting on this queue.

Fixes #2693
This commit is contained in:
Tom 2020-07-05 15:46:51 -06:00 committed by Andreas Kling
parent 2a82a25fec
commit 9725bda63e
Notes: sideshowbarker 2024-07-19 05:07:28 +09:00
5 changed files with 93 additions and 27 deletions

View file

@ -301,6 +301,7 @@ public:
enum class BlockResult {
WokeNormally,
NotBlocked,
InterruptedBySignal,
InterruptedByDeath,
InterruptedByTimeout,