summaryrefslogtreecommitdiffstats
path: root/Master/Real-Time Systems/RTS_A8/src/Task.h
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Real-Time Systems/RTS_A8/src/Task.h')
-rw-r--r--Master/Real-Time Systems/RTS_A8/src/Task.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/Real-Time Systems/RTS_A8/src/Task.h b/Master/Real-Time Systems/RTS_A8/src/Task.h
new file mode 100644
index 0000000..be3b377
--- /dev/null
+++ b/Master/Real-Time Systems/RTS_A8/src/Task.h
@@ -0,0 +1,28 @@
+/*
+ * Task.h
+ *
+ * Created on: 30.11.2010
+ * Author: istsveise
+ */
+
+#ifndef TASK_H_
+#define TASK_H_
+
+#include <semaphore.h>
+
+class Task {
+public:
+ Task(int);
+ virtual ~Task();
+protected:
+ int T; // period in ms
+ sem_t threadSem;
+public:
+ friend void* timer_main(void* task);
+ friend void* execute_main(void* task);
+ virtual void execute() = 0;
+protected:
+ void waitForNextCycle();
+};
+
+#endif /* TASK_H_ */