Kernel: Unblock threads only on unmasked signals

Signals that were explicitly masked should not unblock threads.
This commit is contained in:
Idan Horowitz 2021-12-11 22:37:56 +02:00
parent 81a76a30a1
commit 1397a5ab02
Notes: sideshowbarker 2024-07-17 22:54:58 +09:00

View File

@ -638,6 +638,9 @@ void Thread::send_signal(u8 signal, [[maybe_unused]] Process* sender)
m_pending_signals |= 1 << (signal - 1); 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); 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) { if (m_state == Stopped) {
SpinlockLocker lock(m_lock); SpinlockLocker lock(m_lock);
if (pending_signals_for_state() != 0) { if (pending_signals_for_state() != 0) {