summaryrefslogtreecommitdiffstats
path: root/Master/Real-Time Systems/RTS_A8/src/Task.h
blob: be3b377d84401027ffc7b0968b7f7cc0f529447c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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_ */