mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-06-06 12:29:03 -04:00
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:
parent
0030d609a4
commit
a6d6d1220f
4
queue.c
4
queue.c
|
@ -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();
|
||||
|
|
4
tasks.c
4
tasks.c
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue