From 50b7183bd17c8112d4276fdf8164e7d5b8a7ee36 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Mon, 17 Apr 2023 13:54:48 +0200 Subject: [PATCH] Kernel: Mark the idle thread as active before switching it in Otherwise, our code for dumping all thread stacks gets confused if it finds a thread that is in a 'running' state, but that isn't marked active. --- Kernel/Scheduler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 6602e2a192..454038b2d6 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -99,7 +99,10 @@ Thread& Scheduler::pull_next_runnable_thread() } priority_mask &= ~(1u << priority); } - return *Processor::idle_thread(); + + auto* idle_thread = Processor::idle_thread(); + idle_thread->set_active(true); + return *idle_thread; }); }