comparison TaskManager/Fifo/FifoTaskManagerImpl.cc @ 713:f725c6455d19

remove SIMPLE_TASK conditional
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 16 Dec 2009 15:27:46 +0900
parents 6d497c098455
children cafffff0f45a
comparison
equal deleted inserted replaced
712:4661eaa48b77 713:f725c6455d19
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 }