Mercurial > hg > Game > Cerium
comparison TaskManager/kernel/ppe/TaskManagerImpl.cc @ 495:f2816cf264ae draft
fix wakeup_task
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 10 Oct 2009 19:16:09 +0900 |
parents | 2a7a9f80b8e7 |
children | 67fb962f58fa |
comparison
equal
deleted
inserted
replaced
494:f1470e379c31 | 495:f2816cf264ae |
---|---|
149 * activeQueue へ移す | 149 * activeQueue へ移す |
150 */ | 150 */ |
151 void | 151 void |
152 TaskManagerImpl::wakeup_waitTask(void) | 152 TaskManagerImpl::wakeup_waitTask(void) |
153 { | 153 { |
154 while (TaskQueuePtr p = waitTaskQueue->poll()) { | 154 |
155 for(TaskQueuePtr p = waitTaskQueue->getFirst(); p;) { | |
155 HTaskPtr task = (HTaskPtr)p->task; | 156 HTaskPtr task = (HTaskPtr)p->task; |
156 if (task->wait_i->empty()) { | 157 if (task->wait_i->empty()) { |
158 TaskQueuePtr next = waitTaskQueue->getNext(p); | |
159 waitTaskQueue->remove(p); | |
157 activeTaskQueue->addLast(p); | 160 activeTaskQueue->addLast(p); |
158 } | 161 p = next; |
162 } else { | |
163 p = waitTaskQueue->getNext(p); | |
164 } | |
159 } | 165 } |
160 } | 166 } |
161 | 167 |
162 /* end */ | 168 /* end */ |