diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-28 06:54:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-08 09:55:28 +0200 |
commit | b20b736382280fb522d176273645a7e955a97a60 (patch) | |
tree | beb78ee50ef8b6a9257ecf5f8d276af35db11c5a /cpukit/score/src/schedulersimpleunblock.c | |
parent | score: Add scheduler node implementation header (diff) | |
download | rtems-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.c | 10 |
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 ); } |