summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-16 12:38:24 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-16 12:38:24 +0200
commit24d58554281e900ddfa3955de693840e4a893a72 (patch)
tree52d4f8b11cb159e0a847ed28c31f6eb43af66d71 /Kernel/Scheduler.cpp
parent0e7f85c24a05bdda1c46b80b495bd8a1b88f67c7 (diff)
downloadserenity-24d58554281e900ddfa3955de693840e4a893a72.zip
Kernel: Let the wait blocker inspect *all* child threads of a process
Previously would only grab the first thread in the thread list that had the same PID as our waitee and check if it was stopped.
Diffstat (limited to 'Kernel/Scheduler.cpp')
-rw-r--r--Kernel/Scheduler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index bd630ee4cf..e600161437 100644
--- a/Kernel/Scheduler.cpp
+++ b/Kernel/Scheduler.cpp
@@ -264,9 +264,13 @@ bool Thread::WaitBlocker::should_unblock(Thread& thread, time_t, long)
bool child_exited = child.is_dead();
bool child_stopped = false;
if (child.thread_count()) {
- auto& child_thread = child.any_thread();
- if (child_thread.state() == Thread::State::Stopped && !child_thread.has_pending_signal(SIGCONT))
- child_stopped = true;
+ child.for_each_thread([&](auto& child_thread) {
+ if (child_thread.state() == Thread::State::Stopped && !child_thread.has_pending_signal(SIGCONT)) {
+ child_stopped = true;
+ return IterationDecision::Break;
+ }
+ return IterationDecision::Continue;
+ });
}
bool wait_finished = ((m_wait_options & WEXITED) && child_exited)