mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-13 16:27:43 -04:00
fix(freertos-smp): Remove scheduler suspension from event_groups.c
This commit removes the need for suspending the scheduler when calling some event_groups.c APIs as the non-deterministic operations are happening with the event group being locked and the preemption being disabled from the current task.
This commit is contained in:
parent
c5667e34d0
commit
829d8ba51a
2 changed files with 6 additions and 25 deletions
|
@ -621,13 +621,6 @@
|
||||||
{
|
{
|
||||||
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
|
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
|
||||||
|
|
||||||
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
||||||
|
|
||||||
/* We are about to access the kernel data group non-deterministically,
|
|
||||||
* thus we suspend the kernel data group.*/
|
|
||||||
vTaskSuspendAll();
|
|
||||||
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
|
|
||||||
|
|
||||||
pxListItem = listGET_HEAD_ENTRY( pxList );
|
pxListItem = listGET_HEAD_ENTRY( pxList );
|
||||||
|
|
||||||
/* Set the bits. */
|
/* Set the bits. */
|
||||||
|
@ -698,10 +691,6 @@
|
||||||
|
|
||||||
/* Snapshot resulting bits. */
|
/* Snapshot resulting bits. */
|
||||||
uxReturnBits = pxEventBits->uxEventBits;
|
uxReturnBits = pxEventBits->uxEventBits;
|
||||||
|
|
||||||
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
||||||
( void ) xTaskResumeAll();
|
|
||||||
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
|
|
||||||
}
|
}
|
||||||
( void ) event_groupsUNLOCK( pxEventBits );
|
( void ) event_groupsUNLOCK( pxEventBits );
|
||||||
|
|
||||||
|
@ -726,13 +715,6 @@
|
||||||
{
|
{
|
||||||
traceEVENT_GROUP_DELETE( xEventGroup );
|
traceEVENT_GROUP_DELETE( xEventGroup );
|
||||||
|
|
||||||
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
||||||
|
|
||||||
/* We are about to access the kernel data group non-deterministically,
|
|
||||||
* thus we suspend the kernel data group.*/
|
|
||||||
vTaskSuspendAll();
|
|
||||||
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
|
|
||||||
|
|
||||||
while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
|
while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
|
||||||
{
|
{
|
||||||
/* Unblock the task, returning 0 as the event list is being deleted
|
/* Unblock the task, returning 0 as the event list is being deleted
|
||||||
|
@ -740,10 +722,6 @@
|
||||||
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
|
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
|
||||||
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
|
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
|
|
||||||
( void ) xTaskResumeAll();
|
|
||||||
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
|
|
||||||
}
|
}
|
||||||
( void ) event_groupsUNLOCK( pxEventBits );
|
( void ) event_groupsUNLOCK( pxEventBits );
|
||||||
|
|
||||||
|
|
9
tasks.c
9
tasks.c
|
@ -5977,9 +5977,12 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
|
||||||
|
|
||||||
traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue );
|
traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue );
|
||||||
|
|
||||||
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
|
#if ( !( portUSING_GRANULAR_LOCKS == 1 ) )
|
||||||
* the event flags implementation. */
|
|
||||||
configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
|
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
|
||||||
|
* the event flags implementation. */
|
||||||
|
configASSERT( uxSchedulerSuspended != ( UBaseType_t ) 0U );
|
||||||
|
#endif /* #if ( ! ( portUSING_GRANULAR_LOCKS == 1 ) ) */
|
||||||
|
|
||||||
/* Store the new item value in the event list. */
|
/* Store the new item value in the event list. */
|
||||||
listSET_LIST_ITEM_VALUE( pxEventListItem, xItemValue | taskEVENT_LIST_ITEM_VALUE_IN_USE );
|
listSET_LIST_ITEM_VALUE( pxEventListItem, xItemValue | taskEVENT_LIST_ITEM_VALUE_IN_USE );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue