diff --git a/schedule.c b/schedule.c index 0b7364d..3ffbe70 100644 --- a/schedule.c +++ b/schedule.c @@ -21,8 +21,10 @@ void run_with_quantum(task_struct* task, unsigned int quantum) { } void fcfs() { + printf("Running FCFS\n"); + while (get_task(0) != NULL) { - run_to_completion(remove_task(0)); + run_to_completion(remove_task(get_task(0)->pid)); } } @@ -33,7 +35,7 @@ void priority_queue(unsigned int quantum) { task_struct* task = get_task(0); run_with_quantum(task, quantum); if (task->remaining_cycles > 0) { - remove_task(0); + remove_task(task->pid); } min_heapify();