summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulersimpleunblock.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-28 06:54:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-09-08 09:55:28 +0200
commitb20b736382280fb522d176273645a7e955a97a60 (patch)
treebeb78ee50ef8b6a9257ecf5f8d276af35db11c5a /cpukit/score/src/schedulersimpleunblock.c
parentscore: Add scheduler node implementation header (diff)
downloadrtems-b20b736382280fb522d176273645a7e955a97a60.tar.bz2
score: Introduce _Thread_Get_priority()
Avoid direct access to thread internal data fields.
Diffstat (limited to 'cpukit/score/src/schedulersimpleunblock.c')
-rw-r--r--cpukit/score/src/schedulersimpleunblock.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/score/src/schedulersimpleunblock.c b/cpukit/score/src/schedulersimpleunblock.c
index a020f74767..de08fc1a5a 100644
--- a/cpukit/score/src/schedulersimpleunblock.c
+++ b/cpukit/score/src/schedulersimpleunblock.c
@@ -26,10 +26,12 @@ Scheduler_Void_or_thread _Scheduler_simple_Unblock(
Thread_Control *the_thread
)
{
- Scheduler_simple_Context *context =
- _Scheduler_simple_Get_context( scheduler );
+ Scheduler_simple_Context *context;
+ Priority_Control priority;
+ context = _Scheduler_simple_Get_context( scheduler );
_Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread );
+ priority = _Thread_Get_priority( the_thread );
/*
* If the thread that was unblocked is more important than the heir,
@@ -43,10 +45,10 @@ Scheduler_Void_or_thread _Scheduler_simple_Unblock(
* 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 ) {
+ if ( priority < _Thread_Get_priority( _Thread_Heir ) ) {
_Scheduler_Update_heir(
the_thread,
- the_thread->current_priority == PRIORITY_PSEUDO_ISR
+ priority == PRIORITY_PSEUDO_ISR
);
}