diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-02-18 15:12:44 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-02-18 15:12:44 +0000 |
commit | 108c4b085ccf88e9644fccbf5cec1b79c39e67e4 (patch) | |
tree | df0df1d699d02955750d1691e75ef26fe0c8e1b1 /cpukit/score/src/schedulerpriorityunblock.c | |
parent | 2011-02-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-108c4b085ccf88e9644fccbf5cec1b79c39e67e4.tar.bz2 |
2011-02-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* sapi/include/confdefs.h, score/Makefile.am,
score/include/rtems/score/scheduler.h,
score/include/rtems/score/schedulerpriority.h,
score/include/rtems/score/thread.h,
score/inline/rtems/score/scheduler.inl,
score/inline/rtems/score/schedulerpriority.inl,
score/src/scheduler.c, score/src/schedulerpriority.c,
score/src/schedulerpriorityblock.c,
score/src/schedulerpriorityschedule.c,
score/src/schedulerpriorityunblock.c,
score/src/schedulerpriorityyield.c, score/src/threadchangepriority.c,
score/src/threadclose.c, score/src/threadinitialize.c,
score/src/threadsetpriority.c, score/src/threadsettransient.c:
Significant clean up on Scheduler Plugin Interface. Names were
shortened. Missing operations added. Many scheduler files had
unneeded includes removed. Made pointer to scheduler information in
Thread_Control and Scheduler_Control a void * pointer because the
thread and scheduler wrapper should be unaware of scheduler types AND
this is broken for user provided schedulers.
* score/src/schedulerpriorityallocate.c,
score/src/schedulerpriorityenqueue.c,
score/src/schedulerpriorityenqueuefirst.c,
score/src/schedulerpriorityextract.c,
score/src/schedulerpriorityfree.c,
score/src/schedulerpriorityupdate.c: New files.
* score/src/schedulerprioritythreadschedulerallocate.c,
score/src/schedulerprioritythreadschedulerfree.c,
score/src/schedulerprioritythreadschedulerupdate.c: Removed.
Diffstat (limited to 'cpukit/score/src/schedulerpriorityunblock.c')
-rw-r--r-- | cpukit/score/src/schedulerpriorityunblock.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/cpukit/score/src/schedulerpriorityunblock.c b/cpukit/score/src/schedulerpriorityunblock.c index c0ca1924d2..8c0f490c8c 100644 --- a/cpukit/score/src/schedulerpriorityunblock.c +++ b/cpukit/score/src/schedulerpriorityunblock.c @@ -23,5 +23,26 @@ void _Scheduler_priority_Unblock ( Thread_Control *the_thread ) { - _Scheduler_priority_Unblock_body(the_thread); + _Scheduler_priority_Ready_queue_enqueue(the_thread); + + /* TODO: flash critical section? */ + + /* + * If the thread that was unblocked is more important than the heir, + * then we have a new heir. This may or may not result in a + * context switch. + * + * Normal case: + * If the current thread is preemptible, then we need to do + * a context switch. + * Pseudo-ISR case: + * Even if the thread isn't preemptible, if the new heir is + * a pseudo-ISR system task, we need to do a context switch. + */ + if ( the_thread->current_priority < _Thread_Heir->current_priority ) { + _Thread_Heir = the_thread; + if ( _Thread_Executing->is_preemptible || + the_thread->current_priority == 0 ) + _Thread_Dispatch_necessary = true; + } } |