18,11 → 18,11 |
|
/** |
------------ |
CVS : $Id: kill.c,v 1.9 2004-08-22 10:00:53 giacomo Exp $ |
CVS : $Id: kill.c,v 1.10 2005-01-08 14:42:52 pj Exp $ |
|
File: $File$ |
Revision: $Revision: 1.9 $ |
Last update: $Date: 2004-08-22 10:00:53 $ |
Revision: $Revision: 1.10 $ |
Last update: $Date: 2005-01-08 14:42:52 $ |
------------ |
|
This file contains: |
86,6 → 86,8 |
!(proc_table[exec_shadow].control & TASK_MAKEFREE)) { |
task_makefree(TASK_CANCELED); |
|
scheduler(); |
|
ll_context_to(proc_table[exec_shadow].context); |
// never returns!!! |
} |
191,39 → 193,39 |
/* THIS ASSIGNMENT MUST STAY HERE!!! |
if we move it near the scheduler (after the counter checks) |
the kernel doesn't work, because: |
- if the task is the last one, a sys_end is called, but exec_shadow |
is != -1, so the sys_end calls the task_epilogue that reinsert |
- if the task is the last one, a exit is called, but exec_shadow |
is != -1, so theexit calls the task_epilogue that reinsert |
the KILLED task into the ready queue!!! |
*/ |
exec = exec_shadow = -1; |
|
//DON'T REMOVE !!! BUG IF EXEC_SHADOW = -1 |
//kern_epilogue_macro(); |
/* there is no epilogue... */ |
kern_gettime(&schedule_time); |
/* we don't have to manage the capacity... because we are killing |
ourselves */ |
if (cap_timer != NIL) { |
event_delete(cap_timer); |
cap_timer = NIL; |
} |
|
/* Decrement the Application task counter and end the system |
if necessary*/ |
if (!(proc_table[i].control & SYSTEM_TASK)) { |
//kern_printf("Ûtask%dÛ",task_counter); |
task_counter--; |
if (!task_counter) |
sys_end(); |
if (!task_counter && runlevel == RUNLEVEL_RUNNING) { |
_exit_has_been_called = EXIT_CALLED; |
ll_context_to(global_context);; |
} |
} |
else if (!(proc_table[i].control & NO_KILL)) { |
//kern_printf("Ûsyst%dÛ",system_counter); |
system_counter--; |
if (!system_counter) |
sys_end(); |
if (!system_counter && runlevel == RUNLEVEL_SHUTDOWN) |
ll_context_to(global_context); |
} |
|
//DON'T REMOVE !!! BUG IF EXEC_SHADOW = -1 |
//kern_epilogue_macro(); |
/* there is no epilogue... */ |
kern_gettime(&schedule_time); |
/* we don't have to manage the capacity... because we are killing |
ourselves */ |
if (cap_timer != NIL) { |
event_delete(cap_timer); |
cap_timer = NIL; |
} |
|
scheduler(); |
} |
|
/* |