From 1397a5ab02ad7ab704806398b366b66533f0c25d Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 11 Dec 2021 22:37:56 +0200 Subject: Kernel: Unblock threads only on unmasked signals Signals that were explicitly masked should not unblock threads. --- Kernel/Thread.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Kernel/Thread.cpp') 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) { -- cgit v1.2.3