diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-12-11 22:37:56 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-12-12 08:34:19 +0200 |
commit | 1397a5ab02ad7ab704806398b366b66533f0c25d (patch) | |
tree | 9ed940f850894da6b6450a8e85a5b69d42bb3196 /Kernel/Thread.cpp | |
parent | 81a76a30a15843dacf96abca9b6a119cc6b95440 (diff) | |
download | serenity-1397a5ab02ad7ab704806398b366b66533f0c25d.zip |
Kernel: Unblock threads only on unmasked signals
Signals that were explicitly masked should not unblock threads.
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r-- | Kernel/Thread.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 85d087ffce..c137b6d021 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -638,6 +638,9 @@ void Thread::send_signal(u8 signal, [[maybe_unused]] Process* sender) m_pending_signals |= 1 << (signal - 1); m_have_any_unmasked_pending_signals.store((pending_signals_for_state() & ~m_signal_mask) != 0, AK::memory_order_release); + if (!has_unmasked_pending_signals()) + return; + if (m_state == Stopped) { SpinlockLocker lock(m_lock); if (pending_signals_for_state() != 0) { |