annotate TaskManager/kernel/ppe/HTask.cc @ 547:e5431e658038 draft

continue..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 20 Oct 2009 20:34:47 +0900
parents d6ba5ede4fe7
children fbcbcc5ad3b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include "HTask.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
3 /*!
297
54725883131b start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
4 @brief この Task が待ち合わせする Task を指定する
54725883131b start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
5 @param[in] master この Task が終了待ち合わせをする相手の Task
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
6
297
54725883131b start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
7 繰り返し使用する事で複数の Task を待ち合わせする事ができる。
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
8
297
54725883131b start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
9 wait_for している Task の入力バッファにこの Task から書き込みできる機能があると良い
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
10 */
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
11
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 void
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
13 HTask::wait_for(HTaskPtr master)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 {
546
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
15 TaskQueuePtr m, s;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
17 m = wait_i->create(master);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
18 s = wait_i->create(this);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
19
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
20 master->wait_me->addLast(s);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
21 this->wait_i->addLast(m);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
22 s->waiter = m;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
23
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25
547
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
26 void
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
27 HTask::set_cpu(CPU_TYPE type)
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
28 {
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
29 cpu_type = type;
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
30 }
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
31
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
32 void
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
33 HTask::set_post(PostFunction func_,void *read, void *write)
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
34 {
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
35 post_func = func_;
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
36 post_arg1 = read;
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
37 post_arg2 = write;
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
38 }
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
39
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
40 /* end */