Use the bigger priority whenever possible. (#760)

Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
Moral-Hao 2023-08-19 00:05:10 +08:00 committed by GitHub
parent cdd3678c29
commit 7372519cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2462,8 +2462,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
#if ( configUSE_MUTEXES == 1 ) #if ( configUSE_MUTEXES == 1 )
{ {
/* Only change the priority being used if the task is not /* Only change the priority being used if the task is not
* currently using an inherited priority. */ * currently using an inherited priority or the new priority
if( pxTCB->uxBasePriority == pxTCB->uxPriority ) * is bigger than the inherited priority. */
if( ( pxTCB->uxBasePriority == pxTCB->uxPriority ) || ( uxNewPriority > pxTCB->uxPriority ) )
{ {
pxTCB->uxPriority = uxNewPriority; pxTCB->uxPriority = uxNewPriority;
} }