1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:18:11 +00:00

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

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