mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
fix(freertos): Fixed priority inversion when setting event group bits
This commit fixes a priority inversion when a lower priority task set event group bits to unblock a higher priority task but the lower priority task continued to run.
This commit is contained in:
@@ -4123,10 +4123,19 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
|
|||||||
if( taskIS_YIELD_REQUIRED( pxUnblockedTCB, pdFALSE ) == pdTRUE )
|
if( taskIS_YIELD_REQUIRED( pxUnblockedTCB, pdFALSE ) == pdTRUE )
|
||||||
{
|
{
|
||||||
/* The unblocked task has a priority above that of the calling task, so
|
/* The unblocked task has a priority above that of the calling task, so
|
||||||
* a context switch is required. This function is called with the
|
* a context switch is required. */
|
||||||
* scheduler suspended so xYieldPending is set so the context switch
|
#if ( configNUM_CORES > 1 )
|
||||||
* occurs immediately that the scheduler is resumed (unsuspended). */
|
|
||||||
xYieldPending[ xCurCoreID ] = pdTRUE;
|
/* In SMP mode, this function is called from a critical section, so we
|
||||||
|
* yield the current core to schedule the unblocked task. */
|
||||||
|
portYIELD_WITHIN_API();
|
||||||
|
#else /* configNUM_CORES > 1 */
|
||||||
|
|
||||||
|
/* In single-core mode, this function is called with the scheduler suspended
|
||||||
|
* so xYieldPending is set so the context switch occurs immediately once the
|
||||||
|
* scheduler is resumed (unsuspended). */
|
||||||
|
xYieldPending[ xCurCoreID ] = pdTRUE;
|
||||||
|
#endif /* configNUM_CORES > 1 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user