summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-03-02 20:53:06 +0100
committerRichard Braun <rbraun@sceen.net>2013-03-02 20:53:06 +0100
commitc840709379e499fd7e87904111fe8659ae0c74b6 (patch)
treea4eb673edf57fe8ff533ec4e77dad877b525072b /kern/thread.c
parent600ef79895e9ff28ffaa35ce58da46b2c5be313f (diff)
kern/thread: minor preemption refactoring
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/kern/thread.c b/kern/thread.c
index b1574f35..e52e92af 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -913,28 +913,9 @@ thread_schedule(void)
}
void
-thread_intr_schedule(void)
+thread_reschedule(void)
{
- struct thread *thread;
-
- assert(!cpu_intr_enabled());
-
- thread = thread_self();
- assert(thread != NULL);
-
- if ((thread->preempt == 0) && (thread->flags & THREAD_RESCHEDULE))
- thread_schedule();
-}
-
-void
-thread_preempt_schedule(void)
-{
- struct thread *thread;
-
- thread = thread_self();
- assert(thread != NULL);
-
- if ((thread->preempt == 0))
+ if ((thread_self()->flags & THREAD_RESCHEDULE) && thread_preempt_enabled())
thread_schedule();
}