diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h index 1042607bba..43e8d51296 100644 --- a/cpukit/include/rtems/score/thread.h +++ b/cpukit/include/rtems/score/thread.h @@ -96,9 +96,22 @@ extern "C" { */ #if defined(RTEMS_DEBUG) +/** + * @brief This define enables the thread resource count support. + */ #define RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT #endif +#if defined(RTEMS_POSIX_API) +/** + * @brief This define enables support for an inactive real thread priority. + * + * For example, the POSIX sporadic server may temporarily remove the real + * priority of a thread while it is in low priority mode. + */ +#define RTEMS_SCORE_THREAD_REAL_PRIORITY_MAY_BE_INACTIVE +#endif + /** * @brief Type of the numeric argument of a thread entry function with at * least one numeric argument. diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h index 36ddb785e9..49d9b37899 100644 --- a/cpukit/include/rtems/score/threadimpl.h +++ b/cpukit/include/rtems/score/threadimpl.h @@ -800,6 +800,14 @@ static inline void _Thread_Priority_change( ) { _Priority_Node_set_priority( priority_node, new_priority ); + +#if defined(RTEMS_SCORE_THREAD_REAL_PRIORITY_MAY_BE_INACTIVE) + if ( !_Priority_Node_is_active( priority_node ) ) { + /* The priority change is picked up once the node is added */ + return; + } +#endif + _Thread_Priority_changed( the_thread, priority_node,