1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

Kernel: Send SIGCHLD to the thread with same PID as my PPID

Instead of delivering SIGCHLD to "any thread" in the process with PPID,
send it to the thread with the same TID as my PPID.
This commit is contained in:
Andreas Kling 2020-01-06 14:34:28 +01:00
parent cd42ccd686
commit a803312eb4
Notes: sideshowbarker 2024-07-19 10:18:19 +09:00

View file

@ -2611,13 +2611,12 @@ void Process::finalize()
disown_all_shared_buffers();
{
InterruptDisabler disabler;
if (auto* parent_process = Process::from_pid(m_ppid)) {
// FIXME(Thread): What should we do here? Should we look at all threads' signal actions?
if (parent_process->thread_count() && parent_process->any_thread().m_signal_action_data[SIGCHLD].flags & SA_NOCLDWAIT) {
if (auto* parent_thread = Thread::from_tid(m_ppid)) {
if (parent_thread->m_signal_action_data[SIGCHLD].flags & SA_NOCLDWAIT) {
// NOTE: If the parent doesn't care about this process, let it go.
m_ppid = 0;
} else {
parent_process->send_signal(SIGCHLD, this);
parent_thread->send_signal(SIGCHLD, this);
}
}
}