Mercurial > hg > Members > kono > Cerium
changeset 493:dd091fe6128e
fix free conflict.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 09 Oct 2009 11:29:42 +0900 |
parents | 9522c376a9fe |
children | ec7b6d89b4e4 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskQueueInfo.cc TaskManager/kernel/ppe/TaskQueueInfo.h example/task_queue/ppe/Hello.cc |
diffstat | 6 files changed, 14 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Fri Oct 09 11:18:42 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Fri Oct 09 11:29:42 2009 +0900 @@ -138,7 +138,7 @@ memcpy(task, (Task*)htask, sizeof(Task)); #endif - activeTaskQueue->free(queue); + activeTaskQueue->free_(queue); } }
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Oct 09 11:18:42 2009 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Oct 09 11:29:42 2009 +0900 @@ -123,7 +123,7 @@ list = newList; } - activeTaskQueue->free(queue); + activeTaskQueue->free_(queue); } mainTaskList = list_top;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Fri Oct 09 11:18:42 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Fri Oct 09 11:29:42 2009 +0900 @@ -127,9 +127,9 @@ // 相手の wait queue から自分(を指しているTaskQueue)を削除 wait_i->remove(p->waiter); // queue を free する - wait_i->free(p->waiter); + wait_i->free_(p->waiter); - wait_i->free(p); + wait_i->free_(p); } task->post_func(task->post_arg);
--- a/TaskManager/kernel/ppe/TaskQueueInfo.cc Fri Oct 09 11:18:42 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskQueueInfo.cc Fri Oct 09 11:29:42 2009 +0900 @@ -65,7 +65,7 @@ void -TaskQueueInfo::free(TaskQueuePtr q) +TaskQueueInfo::free_(TaskQueuePtr q) { // if (!q) return; q->next = freeTaskQueue;
--- a/TaskManager/kernel/ppe/TaskQueueInfo.h Fri Oct 09 11:18:42 2009 +0900 +++ b/TaskManager/kernel/ppe/TaskQueueInfo.h Fri Oct 09 11:29:42 2009 +0900 @@ -6,17 +6,18 @@ class TaskQueueInfo : public TaskQueue { - BASE_NEW_DELETE(TaskQueueInfo); public: /* constructor */ TaskQueueInfo(); ~TaskQueueInfo(); + BASE_NEW_DELETE(TaskQueueInfo); + /* functions */ int init(int num); TaskQueuePtr create(Task *task); - void free(TaskQueuePtr queue); + void free_(TaskQueuePtr queue); void addFirst(TaskQueue* e); void addLast(TaskQueue* e);
--- a/example/task_queue/ppe/Hello.cc Fri Oct 09 11:18:42 2009 +0900 +++ b/example/task_queue/ppe/Hello.cc Fri Oct 09 11:29:42 2009 +0900 @@ -20,12 +20,14 @@ for(int i=0;i<100;i++) { TaskQueueInfo *i0 = q->q[i%MAX_QUEUE]; TaskQueueInfo *i1 = q->q[(i+1)%MAX_QUEUE]; + TaskQueue *q0; + TaskQueue *q1; switch(q->m->get_random() % 4) { case 0: - TaskQueue *q0 = i0->create(0); + q0 = i0->create(0); + q1 = i1->create(0); i1->addLast(q0); - TaskQueue *q1 = i1->create(0); i0->addLast(q1); break; case 1: @@ -40,10 +42,10 @@ break; case 3: if (TaskQueue *p = i0->poll()) { - i0->free(p); + i0->free_(p); } if (TaskQueue *p = i1->poll()) { - i1->free(p); + i1->free_(p); } break; }