1
Files
lecture-operating-system-de…/c_os/user/PreemptiveLoopThread.cc
2022-07-11 15:37:45 +02:00

18 lines
341 B
C++

#include "user/PreemptiveLoopThread.h"
void PreemptiveLoopThread::run() {
/* Hier muss Code eingefuegt werden */
int cnt = 0;
while (true) {
// Basic synchronization by semaphore
sem->p();
kout.setpos(55, this->id);
kout << this->id << ": " << dec << cnt++ << endl;
sem->v();
}
}