Skip to content

Commit

Permalink
Added check of status for tasks that are being inserted into task que…
Browse files Browse the repository at this point in the history
…ue during schedule.. (the must be != DEAD)
  • Loading branch information
inuyasha82 committed Nov 18, 2013
1 parent 31f8a76 commit 78816d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Binary file modified boot/grub.img
Binary file not shown.
10 changes: 6 additions & 4 deletions tasks/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void schedule(unsigned int *stack) {
//placeholder
tss_free(cur_task->registers);
dbg_bochs_print("DEAD@@@@");
free(cur_task);
active = TRUE;
free(cur_task);
}

cur_pid = cur_task->pid;
dbg_bochs_print("@@@@@@@");
dbg_bochs_print(cur_task->name);
Expand All @@ -66,8 +66,10 @@ void schedule(unsigned int *stack) {
cur_task->status=READY;
((task_register_t *)(cur_task->esp))->eip = cur_task->eip;
}

enqueue_task(cur_task->pid, cur_task);

if(cur_task->status!=DEAD){
enqueue_task(cur_task->pid, cur_task);
}
cur_task=get_task();

if(cur_task->status==NEW)
Expand Down

0 comments on commit 78816d9

Please sign in to comment.