Fix a bug in the scheduler

This commit is contained in:
Ali Mashtizadeh 2015-01-15 21:24:15 -08:00
parent e1f9737450
commit 64f2ca2259

View File

@ -226,6 +226,14 @@ Thread_Scheduler()
// Select next thread
next = TAILQ_FIRST(&runnableQueue);
if (!next) {
/*
* There may be no other runnable processes on this core. This is a
* good opportunity to migrate threads.
*/
Spinlock_Unlock(&threadLock);
return;
}
TAILQ_REMOVE(&runnableQueue, next, schedQueue);
prev = curProc;