Mercurial > hg > Game > Cerium
diff TaskManager/kernel/schedule/SchedTask.cc @ 187:e9b5dcdae38d draft
fix
author | gongo@localhost.localdomain |
---|---|
date | Thu, 08 Jan 2009 13:46:57 +0900 |
parents | a19d3ed4ce5b |
children | b56fb6ac2fc4 |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Thu Jan 08 13:46:57 2009 +0900 @@ -303,25 +303,20 @@ if (__cur_index < __list->length) { SchedTaskBase *nextSched; - nextSched = __scheduler->get_nextRenewTaskList(__list, __cur_index); + nextSched = __scheduler->get_nextRenewTaskList(); // RenewTask がある if (nextSched) { + __scheduler->set_backupTaskList(__list); + __scheduler->set_backupTaskListIndex(__cur_index); return nextSched; } else { - TaskPtr nextTask - = &__list->tasks[__cur_index++]; + TaskPtr nextTask = &__list->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); ((SchedTask*)nextSched)->__init__(__list, nextTask, __cur_index, __scheduler->get_curReadBuf(), __scheduler->get_curWriteBuf(), __scheduler); - - /** - * この理由は SchedTask:~SchedTask() で - */ - __list = NULL; - return nextSched; } } else { @@ -362,14 +357,18 @@ __list = NULL; return nextSched; } else { - uint32 nextList = (uint32)__list->next; + SchedTaskBase *nextList; + + nextList = __scheduler->get_nextRenewTaskList(); - if (nextList == 0) { + if (nextList) { + return nextList; + } else { TaskListPtr nextList = __scheduler->get_backupTaskList(); - // 中断した TaskList + // 中断した TaskList がある if (nextList) { - __cur_index = __scheduler->bakIndex_taskList; + __cur_index = __scheduler->get_backupTaskListIndex(); nextTask = &nextList->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); @@ -382,11 +381,6 @@ } else { return new SchedNop2Ready(__scheduler); } - } else { - __scheduler->renewTop_taskList - = __scheduler->renewTop_taskList->next; - return createSchedTaskList(nextList, __scheduler, - SCHED_TASKLIST_RENEW); } } }