diff options
author | Richard Braun <rbraun@sceen.net> | 2013-03-02 20:53:06 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-03-02 20:53:06 +0100 |
commit | c840709379e499fd7e87904111fe8659ae0c74b6 (patch) | |
tree | a4eb673edf57fe8ff533ec4e77dad877b525072b /kern/thread.h | |
parent | 600ef79895e9ff28ffaa35ce58da46b2c5be313f (diff) |
kern/thread: minor preemption refactoring
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/kern/thread.h b/kern/thread.h index a8f40e83..9b8017c9 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -173,14 +173,9 @@ void __noreturn thread_run(void); void thread_schedule(void); /* - * Invoke the scheduler from interrupt context. + * Invoke the scheduler if the calling thread is marked for reschedule. */ -void thread_intr_schedule(void); - -/* - * Invoke the scheduler from preemption control functions. - */ -void thread_preempt_schedule(void); +void thread_reschedule(void); /* * Report a periodic timer interrupt on the thread currently running on @@ -256,15 +251,8 @@ thread_preempt_enable_no_resched(void) static inline void thread_preempt_enable(void) { - struct thread *thread; - - barrier(); - thread = thread_self(); - assert(thread->preempt != 0); - thread->preempt--; - - if (thread->flags & THREAD_RESCHEDULE) - thread_preempt_schedule(); + thread_preempt_enable_no_resched(); + thread_reschedule(); } static inline void |