1

fix scheduling bug with deblock

This commit is contained in:
2022-07-14 13:35:34 +02:00
parent b840895164
commit d0387ef545

View File

@ -201,33 +201,8 @@ void Scheduler::deblock(Thread* that) {
/* hier muss Code eingefuegt werden */
cpu.disable_int();
this->readyQueue.enqueue(this->get_active());
this->dispatch(*that); // Prefer deblocked
// NOTE: I wanted to prefer the deblocked thread but did something wrong
// which fucked the queue and didn't continue blocked threads so I
// 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
// }