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