Fix a bug in the scheduler
This commit is contained in:
parent
e1f9737450
commit
64f2ca2259
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user