comparison queue.h @ 0:d4bc23cb728b

Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Wed, 16 Dec 2015 15:16:11 +0900
parents
children b15128ab0324
comparison
equal deleted inserted replaced
-1:000000000000 0:d4bc23cb728b
1 /*
2 OS Scheduler Simulator
3
4 ** 連絡先: 琉球大学情報工学科 河野 真治
5 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp)
6 **
7 ** このソースのいかなる複写,改変,修正も許諾します。ただし、
8 ** その際には、誰が貢献したを示すこの部分を残すこと。
9 ** 再配布や雑誌の付録などの問い合わせも必要ありません。
10 ** 営利利用も上記に反しない範囲で許可します。
11 ** バイナリの配布の際にはversion messageを保存することを条件とします。
12 ** このプログラムについては特に何の保証もしない、悪しからず。
13 **
14 ** Everyone is permitted to do anything on this program
15 ** including copying, modifying, improving,
16 ** as long as you don't try to pretend that you wrote it.
17 ** i.e., the above copyright notice has to appear in all copies.
18 ** Binary distribution requires original version messages.
19 ** You don't have to ask before copying, redistribution or publishing.
20 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
21
22 Task Queue Manager
23
24 ** modify: Atsuki Shimoji(atsuki@cr.ie.u-ryukyu.ac.jp)
25
26 */
27 #ifndef _QUEUE_H_
28 #define _QUEUE_H_
29 #include "dpp_common.h"
30 #include "state_db.h"
31
32 typedef struct task {
33 struct task *next;
34 struct phils *phils;
35 } Task, *TaskPtr;
36
37 typedef struct task_iterator {
38 struct task_iterator *prev;
39 StateDB state;
40 TaskPtr list;
41 TaskPtr last;
42 } TaskIterator, *TaskIteratorPtr;
43
44 extern TaskIteratorPtr
45 create_task_iterator(TaskPtr list,struct state *s,TaskIteratorPtr prev);
46
47 extern TaskPtr
48 next_task_iterator(TaskIteratorPtr self);
49
50 extern void
51 free_task_iterator(TaskIteratorPtr iter);
52
53 extern
54 code create_queue(int count, PhilsPtr self, TaskPtr list, TaskPtr last,
55 code (*dest)(
56 int count,PhilsPtr self, TaskPtr list,TaskPtr last, TaskPtr q
57 ));
58 extern
59 code enqueue(int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
60 code (*dest)(
61 int count, PhilsPtr self, TaskPtr list, TaskPtr last, TaskPtr q,
62 ));
63
64
65 extern void free_queue(TaskPtr q);
66 extern code dequeue(code (*dest)(), TaskPtr list, TaskPtr *q);
67
68 #endif