Kernel: Allow killing queued threads

We need to dequeue and wake threads that are waiting if the process
terminates.

Fixes #3603 without the HackStudio fixes in #3606.
This commit is contained in:
Tom 2020-09-26 10:55:48 -06:00 committed by Andreas Kling
commit 69a9c78783
Notes: sideshowbarker 2024-07-19 02:12:35 +09:00
2 changed files with 26 additions and 6 deletions

View file

@ -438,12 +438,12 @@ public:
// to clean up now while we're still holding m_lock
t.was_unblocked();
if (t.was_interrupted_by_signal())
return BlockResult::InterruptedBySignal;
if (t.was_interrupted_by_death())
return BlockResult::InterruptedByDeath;
if (t.was_interrupted_by_signal())
return BlockResult::InterruptedBySignal;
return BlockResult::WokeNormally;
}
@ -634,6 +634,7 @@ private:
Blocker* m_blocker { nullptr };
timespec* m_blocker_timeout { nullptr };
const char* m_wait_reason { nullptr };
WaitQueue* m_queue { nullptr };
Atomic<bool> m_is_active { false };
bool m_is_joinable { true };