Browse Source

Scheduler: Fix deadlock when first scheduling candidate being inspected

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

Regressed in 53262cd08b08f3d4d2b77cff9c348e84b1bf5eb9.
Andreas Kling 6 years ago
parent
commit
09cd3a7a07
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Kernel/Scheduler.cpp

+ 1 - 1
Kernel/Scheduler.cpp

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