mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-23 15:01:56 -04:00
Use the bigger priority whenever possible. (#760)
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
cdd3678c29
commit
7372519cba
5
tasks.c
5
tasks.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue