summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-01 19:32:16 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-01 19:33:36 +0200
commit09cd3a7a0734403050594d7a135f206baf03363d (patch)
tree4d5299a19045e24f7c4d33caa26877b217067c0c /Kernel/Scheduler.cpp
parent38c80d5e6d214bcc3a2078d752d1eb3975297e6a (diff)
downloadserenity-09cd3a7a0734403050594d7a135f206baf03363d.zip
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.
Diffstat (limited to 'Kernel/Scheduler.cpp')
-rw-r--r--Kernel/Scheduler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index 10b1f899f8..978d889041 100644
--- a/Kernel/Scheduler.cpp
+++ b/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)) {