MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / vTaskRemoveFromUnorderedEventList

Function vTaskRemoveFromUnorderedEventList

tasks.c:4030–4075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4028/*-----------------------------------------------------------*/
4029
4030void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
4031 const TickType_t xItemValue )
4032{
4033 TCB_t * pxUnblockedTCB;
4034
4035 /* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. It is used by
4036 * the event flags implementation. */
4037 configASSERT( uxSchedulerSuspended != pdFALSE );
4038
4039 /* Store the new item value in the event list. */
4040 listSET_LIST_ITEM_VALUE( pxEventListItem, xItemValue | taskEVENT_LIST_ITEM_VALUE_IN_USE );
4041
4042 /* Remove the event list form the event flag. Interrupts do not access
4043 * event flags. */
4044 pxUnblockedTCB = listGET_LIST_ITEM_OWNER( pxEventListItem ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
4045 configASSERT( pxUnblockedTCB );
4046 ( void ) uxListRemove( pxEventListItem );
4047
4048 #if ( configUSE_TICKLESS_IDLE != 0 )
4049 {
4050 /* If a task is blocked on a kernel object then xNextTaskUnblockTime
4051 * might be set to the blocked task's time out time. If the task is
4052 * unblocked for a reason other than a timeout xNextTaskUnblockTime is
4053 * normally left unchanged, because it is automatically reset to a new
4054 * value when the tick count equals xNextTaskUnblockTime. However if
4055 * tickless idling is used it might be more important to enter sleep mode
4056 * at the earliest possible time - so reset xNextTaskUnblockTime here to
4057 * ensure it is updated at the earliest possible time. */
4058 prvResetNextTaskUnblockTime();
4059 }
4060 #endif
4061
4062 /* Remove the task from the delayed list and add it to the ready list. The
4063 * scheduler is suspended so interrupts will not be accessing the ready
4064 * lists. */
4065 ( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) );
4066 prvAddTaskToReadyList( pxUnblockedTCB );
4067
4068 #if ( configUSE_PREEMPTION == 1 )
4069 taskENTER_CRITICAL();
4070 {
4071 prvYieldForTask( pxUnblockedTCB, pdFALSE );
4072 }
4073 taskEXIT_CRITICAL();
4074 #endif
4075}
4076/*-----------------------------------------------------------*/
4077
4078void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )

Callers 2

xEventGroupSetBitsFunction · 0.85
vEventGroupDeleteFunction · 0.85

Calls 3

uxListRemoveFunction · 0.85
prvYieldForTaskFunction · 0.85

Tested by

no test coverage detected