refactor(freertos/smp): Move critical sections inside xTaskPriorityInherit()

xTaskPriorityInherit() is called inside a critical section from queue.c. This
commit moves the critical section into xTaskPriorityInherit().

Co-authored-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
Darian Leung 2024-06-16 00:31:09 +08:00 committed by Sudeep Mohanty
parent 0030d609a4
commit a6d6d1220f
2 changed files with 67 additions and 67 deletions

View file

@ -1792,13 +1792,9 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
#if ( configUSE_MUTEXES == 1 )
{
if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )
{
taskENTER_CRITICAL();
{
xInheritanceOccurred = xTaskPriorityInherit( pxQueue->u.xSemaphore.xMutexHolder );
}
taskEXIT_CRITICAL();
}
else
{
mtCOVERAGE_TEST_MARKER();

View file

@ -6643,6 +6643,8 @@ static void prvResetNextTaskUnblockTime( void )
traceENTER_xTaskPriorityInherit( pxMutexHolder );
taskENTER_CRITICAL();
{
/* If the mutex is taken by an interrupt, the mutex holder is NULL. Priority
* inheritance is not applied in this scenario. */
if( pxMutexHolder != NULL )
@ -6728,6 +6730,8 @@ static void prvResetNextTaskUnblockTime( void )
{
mtCOVERAGE_TEST_MARKER();
}
}
taskEXIT_CRITICAL();
traceRETURN_xTaskPriorityInherit( xReturn );