fix scheduling bug when only 1 thread is available
This commit is contained in:
@ -96,10 +96,12 @@ void Scheduler::yield() {
|
|||||||
|
|
||||||
/* hier muss Code eingefuegt werden */
|
/* hier muss Code eingefuegt werden */
|
||||||
|
|
||||||
// if (this->readyQueue.isEmpty()) {
|
// When only one thread exists (IdleThread) it can't yield as the readyqueue becomes empty
|
||||||
// // Idle thread running
|
// and this is not handled anywhere else
|
||||||
// return;
|
if (this->readyQueue.isEmpty()) {
|
||||||
// }
|
// Idle thread running
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Thread& next = *(Thread*)this->readyQueue.dequeue();
|
Thread& next = *(Thread*)this->readyQueue.dequeue();
|
||||||
this->readyQueue.enqueue(this->get_active());
|
this->readyQueue.enqueue(this->get_active());
|
||||||
|
|||||||
Reference in New Issue
Block a user