1

adapt to new list interface

This commit is contained in:
2022-07-16 18:24:32 +02:00
parent f807558781
commit b454f5d01c
5 changed files with 2 additions and 13 deletions

View File

@ -108,7 +108,7 @@ void Scheduler::kill(Thread* that) {
// Thread-Wechsel durch PIT verhindern
cpu.disable_int();
if (this->ready_queue.remove(that) == -1) {
if (!this->ready_queue.remove(that)) {
log << ERROR << "Can't kill thread that is not in ready_queue, ID: " << dec << that->tid << endl;
cpu.enable_int();
return;

View File

@ -44,10 +44,6 @@ private:
public:
Scheduler() : has_idle_thread(false), log("SCHED") {}
void init() {
this->ready_queue.init();
}
// Scheduler initialisiert?
// Zeitgeber-Unterbrechung kommt evt. bevor der Scheduler fertig
// intiialisiert wurde!

View File

@ -28,9 +28,7 @@ private:
public:
// Konstruktor: Initialisieren des Semaphorzaehlers
Semaphore(int c) : counter(c) {
waitQueue.init();
}
Semaphore(int c) : counter(c) {}
// 'Passieren': Warten auf das Freiwerden eines kritischen Abschnitts.
void p();

View File

@ -58,10 +58,6 @@ int main() {
// This has to happen after the allocator is initialized but before the scheduler is started
pg_init();
// NOTE: Because I introduced dynamic memory inside the scheduler (probably bad idea?) I have to add
// these init methods (allocator has to be initialized before but scheduler is constructed in the globals)
scheduler.init();
// Scheduler starten (schedule() erzeugt den Idle-Thread)
scheduler.ready(new MainMenu()); // NOTE: A thread that manages other threads has to be added before scheduler.schedule(),
// because scheduler.schedule() doesn't return, only threads get cpu time

View File

@ -13,7 +13,6 @@ private:
public:
ArrayListDemo() {
this->list.init();
kout << "Initialized ArrayListDemo" << endl;
}