summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c
index dcf038c3..27cdb1b5 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -251,7 +251,7 @@ thread_schedule(void)
}
void
-thread_reschedule(void)
+thread_intr_schedule(void)
{
struct thread_runq *runq;
struct thread *thread;
@@ -267,6 +267,22 @@ thread_reschedule(void)
}
void
+thread_preempt_schedule(void)
+{
+ struct thread_runq *runq;
+ struct thread *thread;
+
+ runq = thread_runq_local();
+ thread = runq->current;
+ assert(thread != NULL);
+
+ if ((thread->preempt == 0)) {
+ assert(!cpu_intr_enabled());
+ thread_schedule();
+ }
+}
+
+void
thread_tick(void)
{
struct thread_runq *runq;