1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Kernel+LibC: Implement sigtimedwait()

This includes a new Thread::Blocker called SignalBlocker which blocks
until a signal of a matching type is pending. The current Blocker
implementation in the Kernel is very complicated, but cleaning it up is
a different yak for a different day.
This commit is contained in:
Idan Horowitz 2021-12-12 01:01:42 +02:00
parent 13d98999b7
commit 762e047ec9
8 changed files with 120 additions and 0 deletions

View file

@ -637,6 +637,7 @@ 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);
m_signal_blocker_set.unblock_all_blockers_whose_conditions_are_met();
if (!has_unmasked_pending_signals())
return;