1

synchronize with semaphore

This commit is contained in:
2022-07-11 15:37:45 +02:00
parent 66b3b914d0
commit 597b823ac3
3 changed files with 15 additions and 7 deletions

View File

@ -3,17 +3,19 @@
#include "kernel/Globals.h"
#include "kernel/threads/Thread.h"
#include "lib/Semaphore.h"
class PreemptiveLoopThread : public Thread {
private:
int id;
Semaphore* sem;
PreemptiveLoopThread(const PreemptiveLoopThread& copy) = delete; // Verhindere Kopieren
public:
// Gibt der Loop einen Stack und eine Id.
PreemptiveLoopThread(int i) : id(i) {}
PreemptiveLoopThread(int i, Semaphore* sem) : id(i), sem(sem) {}
// Zaehlt einen Zaehler hoch und gibt ihn auf dem Bildschirm aus.
void run() override;