feat(freertos-smp): Light Weight Preemption Disable Locks

This commit is contained in:
Sudeep Mohanty 2025-08-02 10:42:02 +02:00
parent ec3c41e444
commit 40a991d8eb
4 changed files with 223 additions and 22 deletions

View file

@ -883,14 +883,29 @@
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
static BaseType_t prvUnlockEventGroupForTasks( EventGroup_t * pxEventBits )
{
BaseType_t xReturn = pdFALSE;
/* Release the previously held task spinlock */
portRELEASE_SPINLOCK( portGET_CORE_ID(), &( pxEventBits->xTaskSpinlock ) );
/* Re-enable preemption */
vTaskPreemptionEnable( NULL );
/* We assume that the task was preempted when preemption was enabled */
return pdTRUE;
/* Yield if preemption was re-enabled*/
if( xTaskUnlockCanYield() == pdTRUE )
{
taskYIELD_WITHIN_API();
/* Return true as the task was preempted */
xReturn = pdTRUE;
}
else
{
/* Return false as the task was not preempted */
xReturn = pdFALSE;
}
return xReturn;
}
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
/*-----------------------------------------------------------*/