diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-03 10:27:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-04 13:26:17 +0200 |
commit | dafa5d88435853809040761b79ab9d8f2217281b (patch) | |
tree | 35d9d87cbe8d00279cc3fa905792569937ed7fea /cpukit/score/include/rtems/score/threadimpl.h | |
parent | score: Implement SMP-specific priority queue (diff) | |
download | rtems-dafa5d88435853809040761b79ab9d8f2217281b.tar.bz2 |
score: Implement priority boosting
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 46568813a4..1092b65f9b 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -437,6 +437,37 @@ void _Thread_Raise_priority( ); /** + * @brief Inherit the priority of a thread. + * + * It changes the current priority of the inheritor thread to the current priority + * of the ancestor thread if it is higher than the current priority of the inheritor + * thread. In this case the inheritor thread is appended to its new priority group + * in its scheduler instance. + * + * On SMP configurations, the priority is changed to PRIORITY_PSEUDO_ISR in + * case the own schedulers of the inheritor and ancestor thread differ (priority + * boosting). + * + * @param[in] inheritor The thread to inherit the priority. + * @param[in] ancestor The thread to bequeath its priority to the inheritor + * thread. + */ +#if defined(RTEMS_SMP) +void _Thread_Inherit_priority( + Thread_Control *inheritor, + Thread_Control *ancestor +); +#else +RTEMS_INLINE_ROUTINE void _Thread_Inherit_priority( + Thread_Control *inheritor, + Thread_Control *ancestor +) +{ + _Thread_Raise_priority( inheritor, ancestor->current_priority ); +} +#endif + +/** * @brief Sets the current to the real priority of a thread. * * Sets the priority restore hint to false. |