817
|
1 #ifndef INCLUDED_THREADS
|
|
2 #define INCLUDED_THREADS
|
|
3
|
|
4 #include <pthread.h>
|
|
5
|
|
6
|
|
7 class Threads {
|
|
8 public:
|
|
9 /* constructor */
|
|
10 Threads(int num = 1);
|
|
11 virtual ~Threads();
|
|
12
|
|
13 /* functions */
|
|
14 virtual void init() = 0;
|
|
15 virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING
|
|
16 virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK
|
|
17 virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING
|
|
18
|
|
19 /* variables */
|
|
20 pthread_t *threads;
|
|
21 thread_arg_t *args;
|
|
22 int cpu_num;
|
|
23 };
|
|
24
|
|
25 #endif
|