Mercurial > hg > Game > Cerium
changeset 777:c38799cc3f60 draft
fix memory coruption on task self
send mail on write is a bad idea.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 05 Mar 2010 12:48:02 +0900 |
parents | 922c0133c61c |
children | 558c6c856f89 |
files | TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskArray.cc |
diffstat | 2 files changed, 4 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/SchedTask.cc Fri Mar 05 10:12:49 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Fri Mar 05 12:48:02 2010 +0900 @@ -50,7 +50,7 @@ scheduler = sc; cur_index = index; - scheduler->mainMem_wait(); + scheduler->mainMem_wait(); // これはなんで? }
--- a/TaskManager/kernel/schedule/SchedTaskArray.cc Fri Mar 05 10:12:49 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Fri Mar 05 12:48:02 2010 +0900 @@ -137,14 +137,6 @@ free(writebuf); free(inListData.bound); free(outListData.bound); - - // このTaskArrayは終り。終了を知らせる。 - if (!array || atask->next() >= last()) { - SchedTask *s = (SchedTask *)savedTask; - scheduler->mail_write((memaddr)s->task->self); - free(array); - } - } Task *SchedTaskArray::last() @@ -164,7 +156,10 @@ } else { // このTaskArrayは終り。save していた Task の次を返す。 // savedTask の read/exec は実行されない (command = TaskArray) + SchedTask *s = (SchedTask *)savedTask; SchedTaskBase *n = savedTask->next(scheduler, savedTask); + scheduler->mail_write((memaddr)savedTask->task->self); + free(array); delete savedTask; return n; }