浏览代码

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 年之前
父节点
当前提交
09cd3a7a07
共有 1 个文件被更改,包括 1 次插入1 次删除
  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();
     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)) {