complete scheduler
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user