3
|
1 #ifndef INCLUDED_TASK_MANAGER
|
|
2 #define INCLUDED_TASK_MANAGER
|
|
3
|
|
4 #ifndef INCLUDED_TASK_MANAGER_IMPL
|
|
5 # include "TaskManagerImpl.h"
|
|
6 #endif
|
|
7
|
|
8 class TaskManager {
|
|
9 public:
|
|
10 /* constructor */
|
|
11 TaskManager(int num = 1); // The number of threads
|
|
12
|
|
13 /* variables */
|
|
14 TaskManagerImpl *m_impl;
|
|
15
|
|
16 /* functions */
|
|
17 void init(void);
|
20
|
18 void finish(void);
|
109
|
19 HTaskPtr create_task(int cmd);
|
3
|
20 void run(void);
|
|
21
|
109
|
22 void* malloc(int size) {
|
|
23 return m_impl->allocate(size);
|
|
24 }
|
14
|
25
|
3
|
26 private:
|
|
27 int machineNum;
|
|
28 };
|
|
29
|
|
30 #endif
|
109
|
31
|
|
32 extern TaskManager *manager;
|