diff options
author | Itamar <itamar8910@gmail.com> | 2021-09-15 15:55:48 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-16 23:47:46 +0200 |
commit | 9aa6dd6b786d42f6c131d03cba58e9999e0644d0 (patch) | |
tree | ed7b7c11f10e1ee14a8c139aedd61fd935806fb4 /Kernel | |
parent | bb1ad759c552aa9b767c67a16705e7a08234567a (diff) | |
download | serenity-9aa6dd6b786d42f6c131d03cba58e9999e0644d0.zip |
Kernel: Unblock tracer process in Process:unblock_waiters()
Since the tracer process may not be our parent process, we need to
explicitly unblock it (instead of the parent) if we are being traced.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 1b53fc2e7d..3d58a58278 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -661,8 +661,14 @@ void Process::disowned_by_waiter(Process& process) void Process::unblock_waiters(Thread::WaitBlocker::UnblockFlags flags, u8 signal) { - if (auto parent = Process::from_pid(ppid())) - parent->m_wait_blocker_set.unblock(*this, flags, signal); + RefPtr<Process> waiter_process; + if (auto* my_tracer = tracer()) + waiter_process = Process::from_pid(my_tracer->tracer_pid()); + else + waiter_process = Process::from_pid(ppid()); + + if (waiter_process) + waiter_process->m_wait_blocker_set.unblock(*this, flags, signal); } void Process::die() |