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.
This commit is contained in:
Tim Schumacher 2023-04-17 13:54:48 +02:00 committed by Andreas Kling
parent 20f2389e2a
commit 50b7183bd1
Notes: sideshowbarker 2024-07-17 01:27:18 +09:00

View file

@ -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;
});
}