Mercurial > hg > Game > Cerium
comparison TaskManager/Fifo/FifoTaskManagerImpl.cc @ 713:97adb3fe85c6 draft
remove SIMPLE_TASK conditional
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 16 Dec 2009 15:27:46 +0900 |
parents | ec6c897448ca |
children | cc1b7333de92 |
comparison
equal
deleted
inserted
replaced
712:8476791e2905 | 713:97adb3fe85c6 |
---|---|
84 */ | 84 */ |
85 TaskListPtr | 85 TaskListPtr |
86 FifoTaskManagerImpl::get_runTaskList() | 86 FifoTaskManagerImpl::get_runTaskList() |
87 { | 87 { |
88 TaskListPtr list, list_top; | 88 TaskListPtr list, list_top; |
89 #ifdef SIMPLE_TASK | |
90 SimpleTaskPtr task; // Task (SPE に送る Task) | 89 SimpleTaskPtr task; // Task (SPE に送る Task) |
91 #else | |
92 TaskPtr task; // Task (SPE に送る Task) | |
93 #endif | |
94 | 90 |
95 if (activeTaskQueue->empty()) { | 91 if (activeTaskQueue->empty()) { |
96 return NULL; | 92 return NULL; |
97 } | 93 } |
98 | 94 |
104 list = list_top; | 100 list = list_top; |
105 | 101 |
106 // printf("active task queue length = %d\n",activeTaskQueue->length()); | 102 // printf("active task queue length = %d\n",activeTaskQueue->length()); |
107 while (HTaskPtr htask = activeTaskQueue->poll()) { | 103 while (HTaskPtr htask = activeTaskQueue->poll()) { |
108 task = &list->tasks[list->length++]; | 104 task = &list->tasks[list->length++]; |
109 #ifdef SIMPLE_TASK | 105 |
110 if (htask->command==TaskArray1) { | 106 if (htask->command==TaskArray1) { |
111 // compatibility | 107 // compatibility |
112 int next = (htask->r_size+sizeof(SimpleTask))/sizeof(SimpleTask); | 108 int next = (htask->r_size+sizeof(SimpleTask))/sizeof(SimpleTask); |
113 if (list->length+next>=TASK_MAX_SIZE) { | 109 if (list->length+next>=TASK_MAX_SIZE) { |
114 list->length--; | 110 list->length--; |
124 htask->rbuf = 0; htask->r_size = 0; | 120 htask->rbuf = 0; htask->r_size = 0; |
125 *task = *(SimpleTask*)htask; | 121 *task = *(SimpleTask*)htask; |
126 } else { | 122 } else { |
127 *task = *(SimpleTask*)htask; | 123 *task = *(SimpleTask*)htask; |
128 } | 124 } |
129 #else | |
130 memcpy(task, (Task*)htask, sizeof(Task)); | |
131 #endif | |
132 if (list->length >= TASK_MAX_SIZE) { | 125 if (list->length >= TASK_MAX_SIZE) { |
133 TaskListPtr newList = taskListImpl->create(); | 126 TaskListPtr newList = taskListImpl->create(); |
134 list_top = TaskListInfo::append(list_top, newList); | 127 list_top = TaskListInfo::append(list_top, newList); |
135 list = newList; | 128 list = newList; |
136 } | 129 } |