From 3f71e549265c86e526efff9558f935da38a43da1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 12 Mar 2009 22:11:17 +0000 Subject: [PATCH] If a CPU is disabled, continue serving any threads still pinned. Otherwise disabling a CPU in ProcessController at an inopportune time will result in a total system deadlock. Might explain part of the problem in ticket #3535. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29484 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/scheduler/scheduler_simple.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/scheduler/scheduler_simple.cpp b/src/system/kernel/scheduler/scheduler_simple.cpp index 5905b762d6..8da6a8b084 100644 --- a/src/system/kernel/scheduler/scheduler_simple.cpp +++ b/src/system/kernel/scheduler/scheduler_simple.cpp @@ -258,8 +258,12 @@ simple_reschedule(void) prevThread = NULL; if (oldThread->cpu->disabled) { - // CPU is disabled - just select an idle thread + // CPU is disabled - service any threads we may have that are pinned, + // otherwise just select the idle thread while (nextThread && nextThread->priority > B_IDLE_PRIORITY) { + if (nextThread->pinned_to_cpu > 0 && + nextThread->previous_cpu == oldThread->cpu) + break; prevThread = nextThread; nextThread = nextThread->queue_next; }