I have one more question to ask about this function.
Why not update the pxTCB->uxPriority value when the newly set task priority is higher than the inherited priority.
#if ( configUSE_MUTEXES == 1 )
{
/* Only change the priority being used if the task is not
* currently using an inherited priority. */
if( pxTCB->uxBasePriority == pxTCB->uxPriority )
{
pxTCB->uxPriority = uxNewPriority;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* The base priority gets set whatever. */
pxTCB->uxBasePriority = uxNewPriority;
}
#else /* if ( configUSE_MUTEXES == 1 ) */
{
pxTCB->uxPriority = uxNewPriority;
}
#endif /* if ( configUSE_MUTEXES == 1 ) */