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/include/rtems/score/threadimpl.h | |
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 '')
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index adb10cbd6f..1fce842533 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -930,6 +930,24 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources( } /** + * @brief Returns the priority of the thread. + * + * Returns the user API and thread wait information relevant thread priority. + * This includes temporary thread priority adjustments due to locking + * protocols, a job release or the POSIX sporadic server for example. + * + * @return The priority of the thread. + * + * @see _Scheduler_Node_get_priority(). + */ +RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority( + const Thread_Control *the_thread +) +{ + return the_thread->current_priority; +} + +/** * @brief Acquires the thread wait default lock inside a critical section * (interrupts disabled). * |