1

implement + enable demos

This commit is contained in:
2022-07-04 21:24:35 +02:00
parent 7ab5fdb361
commit 1ae227ae33
7 changed files with 110 additions and 4 deletions

View File

@ -0,0 +1,18 @@
#include "user/PreemptiveThreadDemo.h"
void PreemptiveThreadDemo::run() {
kout << "Allocating LoopThread A" << endl;
Thread* cntA = new PreemptiveLoopThread(0);
kout << "Allocating LoopThread B" << endl;
Thread* cntB = new PreemptiveLoopThread(1);
kout << "Allocating LoopThread C" << endl;
Thread* cntC = new PreemptiveLoopThread(2);
kout << "Adding threads to ready queue" << endl;
scheduler.ready(cntA);
scheduler.ready(cntB);
scheduler.ready(cntC);
kout << "Exiting main thread" << endl;
scheduler.exit();
}