Skip to content

Commit 7372519

Browse files
Moral-Haoaggarg
andauthored
Use the bigger priority whenever possible. (#760)
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
1 parent cdd3678 commit 7372519

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tasks.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,8 +2462,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
24622462
#if ( configUSE_MUTEXES == 1 )
24632463
{
24642464
/* Only change the priority being used if the task is not
2465-
* currently using an inherited priority. */
2466-
if( pxTCB->uxBasePriority == pxTCB->uxPriority )
2465+
* currently using an inherited priority or the new priority
2466+
* is bigger than the inherited priority. */
2467+
if( ( pxTCB->uxBasePriority == pxTCB->uxPriority ) || ( uxNewPriority > pxTCB->uxPriority ) )
24672468
{
24682469
pxTCB->uxPriority = uxNewPriority;
24692470
}

0 commit comments

Comments
 (0)