Removed another goto from scheduler.

This commit is contained in:
Bahadir Balban
2009-12-14 12:53:41 +02:00
parent d47b0acaea
commit 16818191b3

View File

@@ -411,7 +411,7 @@ void schedule()
} }
/* Determine the next task to be run */ /* Determine the next task to be run */
get_runnable_task: do {
if (scheduler.rq_runnable->total > 0) { if (scheduler.rq_runnable->total > 0) {
next = link_to_struct(scheduler.rq_runnable->task_list.next, next = link_to_struct(scheduler.rq_runnable->task_list.next,
struct ktcb, rq_list); struct ktcb, rq_list);
@@ -422,13 +422,15 @@ get_runnable_task:
scheduler.rq_runnable->task_list.next, scheduler.rq_runnable->task_list.next,
struct ktcb, rq_list); struct ktcb, rq_list);
} else { } else {
/* If process, poll forever for new tasks */ /* Irq preemptions return to current task
if (in_process_context()) * if no runnable tasks are available */
goto get_runnable_task;
else /* If irq, resume current context */
next = current; next = current;
} }
} }
/* If process context, poll forever for new tasks */
} while (scheduler.rq_runnable->total == 0 &&
scheduler.rq_expired->total == 0 &&
in_process_context());
/* New tasks affect runqueue total priority. */ /* New tasks affect runqueue total priority. */
if (next->flags & TASK_RESUMING) if (next->flags & TASK_RESUMING)