# HG changeset patch # User Shinji KONO # Date 1255169769 -32400 # Node ID 17319af4ee399d62e98de00618fc1d455b6956b9 # Parent ec7b6d89b4e4b5586ad162afabd5885dffe8a11c fix wakeup_task diff -r ec7b6d89b4e4 -r 17319af4ee39 TaskManager/kernel/ppe/TaskManagerImpl.cc --- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat Oct 10 17:30:29 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat Oct 10 19:16:09 2009 +0900 @@ -151,11 +151,17 @@ void TaskManagerImpl::wakeup_waitTask(void) { - while (TaskQueuePtr p = waitTaskQueue->poll()) { + + for(TaskQueuePtr p = waitTaskQueue->getFirst(); p;) { HTaskPtr task = (HTaskPtr)p->task; if (task->wait_i->empty()) { + TaskQueuePtr next = waitTaskQueue->getNext(p); + waitTaskQueue->remove(p); activeTaskQueue->addLast(p); - } + p = next; + } else { + p = waitTaskQueue->getNext(p); + } } } diff -r ec7b6d89b4e4 -r 17319af4ee39 TaskManager/kernel/ppe/TaskQueueInfo.cc --- a/TaskManager/kernel/ppe/TaskQueueInfo.cc Sat Oct 10 17:30:29 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskQueueInfo.cc Sat Oct 10 19:16:09 2009 +0900 @@ -182,5 +182,13 @@ return next == this; } +TaskQueue* +TaskQueueInfo::getNext(TaskQueue* q) +{ + if (q->next==this) return NULL; + return q->next; +} + + /* end */ diff -r ec7b6d89b4e4 -r 17319af4ee39 TaskManager/kernel/ppe/TaskQueueInfo.h --- a/TaskManager/kernel/ppe/TaskQueueInfo.h Sat Oct 10 17:30:29 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskQueueInfo.h Sat Oct 10 19:16:09 2009 +0900 @@ -29,6 +29,9 @@ int empty(); void TaskQueueInfo::freePool() ; + // Iterator + TaskQueue* getNext(TaskQueue* q) ; + int hasNext(TaskQueue* q); private: /* variables */