From b20b736382280fb522d176273645a7e955a97a60 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 28 Jun 2016 06:54:50 +0200 Subject: score: Introduce _Thread_Get_priority() Avoid direct access to thread internal data fields. --- cpukit/score/include/rtems/score/threadimpl.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cpukit/score/include/rtems/score/threadimpl.h') 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 @@ -929,6 +929,24 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources( return 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). -- cgit v1.2.3