fix scheduling bug with deblock
This commit is contained in:
@ -201,33 +201,8 @@ void Scheduler::deblock(Thread* that) {
|
|||||||
|
|
||||||
/* hier muss Code eingefuegt werden */
|
/* hier muss Code eingefuegt werden */
|
||||||
|
|
||||||
cpu.disable_int();
|
// NOTE: I wanted to prefer the deblocked thread but did something wrong
|
||||||
this->readyQueue.enqueue(this->get_active());
|
// which fucked the queue and didn't continue blocked threads so I
|
||||||
this->dispatch(*that); // Prefer deblocked
|
// left it at ready(that).
|
||||||
|
this->ready(that);
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Don't need these, input blocked threads are managed inside event manager
|
|
||||||
// These blocking functions are mainly for KeyEvents
|
|
||||||
// void Scheduler::block() {
|
|
||||||
// if (this->readyQueue.isEmpty()) {
|
|
||||||
// // Something went seriously wrong
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// cpu.disable_int();
|
|
||||||
// this->blockQueue.enqueue(this->get_active());
|
|
||||||
// Thread& next = *(Thread*)this->readyQueue.dequeue();
|
|
||||||
// this->dispatch(next);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void Scheduler::deblock(Thread* that) {
|
|
||||||
// if (this->blockQueue.isEmpty()) {
|
|
||||||
// // Something went seriously wrong
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// cpu.disable_int();
|
|
||||||
// this->readyQueue.enqueue(this->get_active());
|
|
||||||
// this->blockQueue.remove(that);
|
|
||||||
// this->dispatch(*that); // Prefer deblocked
|
|
||||||
// }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user