46
|
1 #ifndef INCLUDED_TASK_QUEUE_INFO
|
|
2 #define INCLUDED_TASK_QUEUE_INFO
|
|
3
|
|
4 #ifndef INCLUDED_TASK
|
|
5 # include "task.h"
|
|
6 #endif
|
|
7
|
|
8 #ifndef INCLUDED_HTASK_INFO
|
|
9 # include "HTaskInfo.h"
|
|
10 #endif
|
|
11
|
54
|
12 typedef struct task_queue {
|
|
13 HTaskPtr task;
|
|
14 TaskQueuePtr next;
|
|
15 } TaskQueue, *TaskQueuePtr;
|
|
16
|
46
|
17 class TaskQueueInfo {
|
|
18 public:
|
|
19 /* constructor */
|
|
20 TaskQueueInfo(void);
|
|
21 ~TaskQueueInfo(void);
|
|
22
|
|
23 /* functions */
|
|
24 int init(int num);
|
|
25 TaskQueuePtr create(HTaskPtr task);
|
|
26 void free(TaskQueuePtr queue);
|
|
27 static TaskQueuePtr append(TaskQueuePtr list, TaskQueuePtr q);
|
|
28
|
|
29 private:
|
|
30 /* variables */
|
|
31 TaskQueuePtr taskQueuePool;
|
|
32 TaskQueuePtr freeTaskQueue;
|
|
33
|
|
34 /* functions */
|
|
35 int extend_pool(int num);
|
|
36 void destroy(void);
|
|
37 };
|
|
38
|
|
39 #endif
|