add: zombify task
This commit is contained in:
@ -12,15 +12,15 @@ struct task *current_task;
|
||||
void scheduler(void)
|
||||
{
|
||||
// ZOMBIE, THREAD, RUN, WAIT, SLEEP, STOPPED, FORKED
|
||||
void (*func[])(struct task *) = {remove_task, NULL, NULL, NULL,
|
||||
NULL, remove_task, kfork};
|
||||
void (*func[])(struct task *) = {zombify_task, NULL, NULL, NULL,
|
||||
NULL, remove_task, kfork};
|
||||
|
||||
if (!current_task) // || current_task->next == current_task)
|
||||
return;
|
||||
cli();
|
||||
struct task *it = current_task->next;
|
||||
while (it && it->status != RUN) {
|
||||
if (it != current_task && func[it->status]) {
|
||||
if (current_task->pid == 0 && func[it->status]) {
|
||||
struct task *new_it = it->prev;
|
||||
func[it->status](it);
|
||||
it = new_it;
|
||||
|
||||
Reference in New Issue
Block a user