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

Kernel: Move signal handlers from being thread state to process state

POSIX requires that sigaction() and friends set a _process-wide_ signal
handler, so move signal handlers and flags inside Process.
This also fixes a "pid/tid confusion" FIXME, as we can now send the
signal to the process and let that decide which thread should get the
signal (which is the thread with tid==pid, but that's now the Process's
problem).
Note that each thread still retains its signal mask, as that is local to
each thread.
This commit is contained in:
Ali Mohammad Pur 2022-02-24 22:25:49 +03:30 committed by Andreas Kling
parent 18b9d02edd
commit cf63447044
5 changed files with 19 additions and 19 deletions

View file

@ -46,12 +46,6 @@ enum class DispatchSignalResult {
Continue
};
struct SignalActionData {
VirtualAddress handler_or_sigaction;
u32 mask { 0 };
int flags { 0 };
};
struct ThreadSpecificData {
ThreadSpecificData* self;
};
@ -1225,7 +1219,7 @@ private:
NonnullOwnPtr<Memory::Region> m_kernel_stack_region;
VirtualAddress m_thread_specific_data;
Optional<Memory::VirtualRange> m_thread_specific_range;
Array<SignalActionData, NSIG> m_signal_action_data;
Array<Optional<u32>, NSIG> m_signal_action_masks;
Blocker* m_blocker { nullptr };
Kernel::Mutex* m_blocking_mutex { nullptr };
u32 m_lock_requested_count { 0 };