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

Scheduler: Fix deadlock when first scheduling candidate being inspected

Somewhat reproducible by opening ProcessManager and trying to view the
stacks for WindowServer.

Regressed in 53262cd08b.
This commit is contained in:
Andreas Kling 2019-08-01 19:32:16 +02:00
parent 38c80d5e6d
commit 09cd3a7a07

View file

@ -396,7 +396,7 @@ bool Scheduler::pick_next()
auto* previous_head = runnable_list.first();
for (;;) {
// Move head to tail.
runnable_list.append(*previous_head);
runnable_list.append(*runnable_list.first());
auto* thread = runnable_list.first();
if (!thread->process().is_being_inspected() && (thread->state() == Thread::Runnable || thread->state() == Thread::Running)) {