Mercurial > hg > Members > kono > Cerium
comparison example/task_queue/main.cc @ 619:0decff4e867b
RenewTask removal
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Nov 2009 02:02:30 +0900 |
parents | 58240647b23b |
children | 60aa3f241b10 |
comparison
equal
deleted
inserted
replaced
618:360032cc500e | 619:0decff4e867b |
---|---|
29 } | 29 } |
30 | 30 |
31 Queues queues; | 31 Queues queues; |
32 | 32 |
33 static void | 33 static void |
34 repeat(void *arg) | 34 repeat(SchedTask *s, void *arg, void *dm) |
35 { | 35 { |
36 static int count = 4; | 36 static int count = 4; |
37 QueuePtr q = (QueuePtr) arg; | 37 QueuePtr q = (QueuePtr) arg; |
38 TaskManager *manager = q->m; | 38 TaskManager *manager = q->m; |
39 | 39 |
40 if (count-->0) { | 40 if (count-->0) { |
41 HTask *t = manager->create_task(HELLO_TASK); | 41 HTask *t = manager->create_task(HELLO_TASK); |
42 t->set_post(repeat, arg); | 42 t->set_post(repeat, arg, 0); |
43 t->add_param(q->i); | 43 t->add_param(q->i); |
44 t->add_param((int)arg); | 44 t->add_param((int)arg); |
45 t->spawn(); | 45 t->spawn(); |
46 | 46 |
47 printf("[PPE] Create Task : Hello count=%d id=%d\n\n",count, q->i); | 47 printf("[PPE] Create Task : Hello count=%d id=%d\n\n",count, q->i); |
89 q->q[j] = queues.q[j]; | 89 q->q[j] = queues.q[j]; |
90 } | 90 } |
91 | 91 |
92 hello->add_param(i); | 92 hello->add_param(i); |
93 hello->add_param((int)&queues); | 93 hello->add_param((int)&queues); |
94 hello->set_post(repeat, (void*) &queues); | 94 hello->set_post(repeat, (void*) &queues, 0); |
95 | 95 |
96 hello->spawn(); | 96 hello->spawn(); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |