summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
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/posix
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/posix')
-rw-r--r--cpukit/posix/src/killinfo.c12
-rw-r--r--cpukit/posix/src/pthread.c6
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c2
-rw-r--r--cpukit/posix/src/pthreadsetschedprio.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index 2e7bacbb78..7cf74eb0bf 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -220,7 +220,7 @@ int _POSIX_signals_Send(
printk("\n 0x%08x/0x%08x %d/%d 0x%08x 1",
the_thread->Object.id,
((interested) ? interested->Object.id : 0),
- the_thread->current_priority, interested_priority,
+ _Thread_Get_priority( the_thread ), interested_priority,
the_thread->current_state
);
#endif
@@ -229,7 +229,7 @@ int _POSIX_signals_Send(
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
- if ( the_thread->current_priority > interested_priority )
+ if ( _Thread_Get_priority( the_thread ) > interested_priority )
continue;
DEBUG_STEP("2");
@@ -256,9 +256,9 @@ int _POSIX_signals_Send(
* so we never have to worry about deferencing a NULL
* interested thread.
*/
- if ( the_thread->current_priority < interested_priority ) {
+ if ( _Thread_Get_priority( the_thread ) < interested_priority ) {
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = _Thread_Get_priority( the_thread );
continue;
}
DEBUG_STEP("4");
@@ -276,7 +276,7 @@ int _POSIX_signals_Send(
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = _Thread_Get_priority( the_thread );
continue;
}
@@ -287,7 +287,7 @@ int _POSIX_signals_Send(
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
DEBUG_STEP("8");
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = _Thread_Get_priority( the_thread );
continue;
}
}
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index b29acaeea5..a1394a5dee 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -97,7 +97,7 @@ static bool _POSIX_Threads_Sporadic_timer_filter(
new_priority = api->Sporadic.high_priority;
*new_priority_p = new_priority;
- current_priority = the_thread->current_priority;
+ current_priority = _Thread_Get_priority( the_thread );
the_thread->real_priority = new_priority;
_Watchdog_Per_CPU_remove_relative( &api->Sporadic.Timer );
@@ -145,7 +145,7 @@ static bool _POSIX_Threads_Sporadic_budget_callout_filter(
new_priority = api->Sporadic.low_priority;
*new_priority_p = new_priority;
- current_priority = the_thread->current_priority;
+ current_priority = _Thread_Get_priority( the_thread );
the_thread->real_priority = new_priority;
return _Thread_Priority_less_than( current_priority, new_priority )
@@ -184,7 +184,7 @@ static bool _POSIX_Threads_Create_extension(
_POSIX_Threads_Initialize_attributes( &api->Attributes );
api->Attributes.schedparam.sched_priority = _POSIX_Priority_From_core(
_Scheduler_Get_own( created ),
- created->current_priority
+ _Thread_Get_priority( created )
);
/*
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index 92560fc79c..e3711e368c 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -81,7 +81,7 @@ static bool _POSIX_Set_sched_param_filter(
*new_priority_p = core_high_prio;
- current_priority = the_thread->current_priority;
+ current_priority = _Thread_Get_priority( the_thread );
the_thread->real_priority = core_high_prio;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
diff --git a/cpukit/posix/src/pthreadsetschedprio.c b/cpukit/posix/src/pthreadsetschedprio.c
index fd77b6894a..fac86d2609 100644
--- a/cpukit/posix/src/pthreadsetschedprio.c
+++ b/cpukit/posix/src/pthreadsetschedprio.c
@@ -49,7 +49,7 @@ static bool _POSIX_Set_sched_prio_filter(
*new_priority_p = new_priority;
- current_priority = the_thread->current_priority;
+ current_priority = _Thread_Get_priority( the_thread );
the_thread->real_priority = new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];