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
|
14
|
8 #ifndef INCLUDED_SYMTABLE
|
|
9 # include "SymTable.h"
|
|
10 #endif
|
|
11
|
3
|
12 class TaskManager {
|
|
13 public:
|
|
14 /* constructor */
|
|
15 TaskManager(int num = 1); // The number of threads
|
|
16
|
|
17 /* variables */
|
|
18 TaskManagerImpl *m_impl;
|
14
|
19 static SymTable *symtb;
|
3
|
20
|
|
21 /* functions */
|
|
22 void init(void);
|
|
23 HTaskPtr create_task(int cmd, int siz, unsigned long long in_addr,
|
|
24 unsigned long long out_addr, void (*func)(void));
|
|
25 void set_task_depend(HTaskPtr master, HTaskPtr slave);
|
18
|
26 void spawn_task(HTaskPtr);
|
3
|
27 void run(void);
|
|
28
|
14
|
29 void set_init_task(const char *sym);
|
|
30
|
|
31 void set_symbol(const char *sym, void *addr);
|
|
32 int open(const char *sym);
|
|
33 static void* get_address(int fd);
|
|
34
|
3
|
35 private:
|
|
36 int machineNum;
|
|
37 };
|
|
38
|
|
39 #endif
|