From 907049c405e9abb88757248cd24fa1bb16df6380 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 2 May 2024 10:58:34 +0200 Subject: [PATCH] kernel: Signal the reap thread when a kernel thread exits via exit_and_signal_parent() This shouldn't happen, but just in case. --- kernel/src/thread/Thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/src/thread/Thread.cpp b/kernel/src/thread/Thread.cpp index b5062693..e35cca9e 100644 --- a/kernel/src/thread/Thread.cpp +++ b/kernel/src/thread/Thread.cpp @@ -109,7 +109,10 @@ Result> Thread::resolve_atfile(int dirfd, const String& pa #else if (this->id == 1) CPU::magic_exit(_status); #endif - if (is_kernel) state = ThreadState::Dying; + if (is_kernel) { + state = ThreadState::Dying; + Scheduler::signal_reap_thread(); + } else { Scheduler::for_each_child(this, [](Thread* child) {