1

complete scheduler

This commit is contained in:
churl
2022-06-15 21:32:23 +02:00
parent 49adb1c1f0
commit 0e72cebc40

View File

@ -77,6 +77,8 @@ void Scheduler::exit() {
void Scheduler::kill(Thread* that) {
/* hier muss Code eingefuegt werden */
this->readyQueue.remove(that);
}
/*****************************************************************************
@ -94,13 +96,12 @@ void Scheduler::yield() {
/* hier muss Code eingefuegt werden */
if (this->readyQueue.isEmpty()) {
// Idle thread running
return;
}
this->readyQueue.enqueue(this->get_active());
// if (this->readyQueue.isEmpty()) {
// // Idle thread running
// return;
// }
Thread& next = *(Thread*)this->readyQueue.dequeue();
this->readyQueue.enqueue(this->get_active());
this->dispatch(next);
}