1

implement new list interface (optional)

This commit is contained in:
2022-07-19 23:36:57 +02:00
parent 241699a9bf
commit 18c659c4cc
6 changed files with 83 additions and 47 deletions

View File

@ -22,7 +22,13 @@ void Semaphore::v() {
if (!this->waitQueue.empty()) {
// Semaphore stays busy and unblocks next thread to work in critical section
Thread* next = (Thread*)this->waitQueue.remove_first();
Thread* next = this->waitQueue.remove_first().value_or(nullptr);
if (next == nullptr) {
// TODO: Log this once the logger is static
this->lock.release();
return;
}
this->lock.release();
scheduler.deblock(next);
} else {