Mercurial > hg > Game > Cerium
comparison TaskManager/kernel/ppe/TaskManagerImpl.cc @ 831:b3c004fe6bc3 draft
CheckTaskList Mail working
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 May 2010 17:48:39 +0900 |
parents | af2fb2e641eb |
children | 577bde5d0cec |
comparison
equal
deleted
inserted
replaced
830:af2fb2e641eb | 831:b3c004fe6bc3 |
---|---|
177 */ | 177 */ |
178 void | 178 void |
179 TaskManagerImpl::check_task_list_finish(SchedTask *s, TaskListPtr list, HTaskInfo *wait_queue) | 179 TaskManagerImpl::check_task_list_finish(SchedTask *s, TaskListPtr list, HTaskInfo *wait_queue) |
180 { | 180 { |
181 for(int i = 0;i<list->length;i++) { | 181 for(int i = 0;i<list->length;i++) { |
182 SimpleTaskPtr task = &list->tasks[list->length++]; | 182 SimpleTaskPtr task = &list->tasks[i]; |
183 HTask *me = (HTask*)task->self; | 183 HTask *me = (HTask*)task->self; |
184 me->post_func(s, me->post_arg1, me->post_arg2); | 184 me->post_func(s, me->post_arg1, me->post_arg2); |
185 if (task->command==TaskArray1) { | 185 if (task->command==TaskArray1) { |
186 int next = (task->r_size)/sizeof(SimpleTask); | 186 int next = ((task->r_size)/sizeof(SimpleTask))+1; |
187 // assert(next<list->length); | 187 // assert(next<list->length); |
188 i+=next; | 188 i+=next; |
189 } | 189 } |
190 check_task_finish(me, wait_queue); | 190 check_task_finish(me, wait_queue); |
191 } | 191 } |
233 if (list->length>=TASK_MAX_SIZE) { | 233 if (list->length>=TASK_MAX_SIZE) { |
234 perror("task array1 overflow\n"); | 234 perror("task array1 overflow\n"); |
235 } | 235 } |
236 memcpy(array, htask->rbuf, htask->r_size); | 236 memcpy(array, htask->rbuf, htask->r_size); |
237 free(htask->rbuf); | 237 free(htask->rbuf); |
238 htask->rbuf = 0; htask->r_size = 0; | 238 // htask->rbuf = 0; htask->r_size = 0; we need this... |
239 *task = *(SimpleTask*)htask; | 239 *task = *(SimpleTask*)htask; |
240 } else { | 240 } else { |
241 *task = *(SimpleTask*)htask; | 241 *task = *(SimpleTask*)htask; |
242 } | 242 } |
243 if (list->length >= TASK_MAX_SIZE) { | 243 if (list->length >= TASK_MAX_SIZE) { |