diff options
author | Alexis211 <alexis211@gmail.com> | 2010-08-10 22:17:24 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-08-10 22:17:24 +0200 |
commit | a75acb568a301903f00d3230467de2a097cce0db (patch) | |
tree | 27dab61327d56238aafaad3d4a291da422c3bed1 /src/kernel/task/task.c | |
parent | c7c2e36c2bb2cf7302f60a70e0ede0490f98b05e (diff) | |
download | TCE-a75acb568a301903f00d3230467de2a097cce0db.tar.gz TCE-a75acb568a301903f00d3230467de2a097cce0db.zip |
Added priorities to the scheduler.
Diffstat (limited to 'src/kernel/task/task.c')
-rw-r--r-- | src/kernel/task/task.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/task/task.c b/src/kernel/task/task.c index 9d64b9e..8dcf713 100644 --- a/src/kernel/task/task.c +++ b/src/kernel/task/task.c @@ -24,7 +24,7 @@ extern void task_idle(void*); static uint32_t nextpid = 1; struct process *processes = 0, *kernel_process; -struct thread *current_thread = 0, *idle_thread; +struct thread *current_thread = 0, *idle_thread = 0; uint32_t tasking_tmpStack[KSTACKSIZE]; @@ -76,11 +76,11 @@ void tasking_switch() { current_thread->esp = esp; current_thread->ebp = ebp; current_thread->eip = eip; - if (current_thread->state == TS_RUNNING && current_thread != idle_thread) sched_enqueue(current_thread); + if (current_thread->state == TS_RUNNING) sched_enqueue(current_thread); } current_thread = sched_dequeue(); - if (current_thread == 0) current_thread = idle_thread; + ASSERT(current_thread != 0); pagedir_switch(current_thread->process->pagedir); |