1

switch cpu methods to static

This commit is contained in:
2022-07-24 00:29:21 +02:00
parent a5c14da0de
commit 605d4e8c8d
11 changed files with 52 additions and 62 deletions

View File

@ -13,7 +13,7 @@ void Semaphore::p() {
// Block and manage thread in semaphore queue until it's woken up by v() again
this->wait_queue.push_back(scheduler.get_active());
cpu.disable_int(); // Make sure the block() comes through after releasing the lock
CPU::disable_int(); // Make sure the block() comes through after releasing the lock
this->lock.release();
scheduler.block(); // Moves to next thread, enables int
}
@ -27,7 +27,7 @@ void Semaphore::v() {
unsigned int tid = this->wait_queue.front();
this->wait_queue.erase(wait_queue.begin());
cpu.disable_int(); // Make sure the deblock() comes through after releasing the lock
CPU::disable_int(); // Make sure the deblock() comes through after releasing the lock
this->lock.release();
scheduler.deblock(tid); // Enables int
} else {

View File

@ -13,7 +13,6 @@
#define __SpinLock_include__
class SpinLock {
private:
SpinLock(const SpinLock& copy) = delete; // Verhindere Kopieren