| 2950 | /*----------------------------------------------------------*/ |
| 2951 | |
| 2952 | BaseType_t xTaskResumeAll( void ) |
| 2953 | { |
| 2954 | TCB_t * pxTCB = NULL; |
| 2955 | BaseType_t xAlreadyYielded = pdFALSE; |
| 2956 | |
| 2957 | if( xSchedulerRunning != pdFALSE ) |
| 2958 | { |
| 2959 | /* It is possible that an ISR caused a task to be removed from an event |
| 2960 | * list while the scheduler was suspended. If this was the case then the |
| 2961 | * removed task will have been added to the xPendingReadyList. Once the |
| 2962 | * scheduler has been resumed it is safe to move all the pending ready |
| 2963 | * tasks from this list into their appropriate ready list. */ |
| 2964 | taskENTER_CRITICAL(); |
| 2965 | { |
| 2966 | BaseType_t xCoreID; |
| 2967 | |
| 2968 | xCoreID = portGET_CORE_ID(); |
| 2969 | |
| 2970 | /* If uxSchedulerSuspended is zero then this function does not match a |
| 2971 | * previous call to vTaskSuspendAll(). */ |
| 2972 | configASSERT( uxSchedulerSuspended ); |
| 2973 | |
| 2974 | --uxSchedulerSuspended; |
| 2975 | portRELEASE_TASK_LOCK(); |
| 2976 | |
| 2977 | if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE ) |
| 2978 | { |
| 2979 | if( uxCurrentNumberOfTasks > ( UBaseType_t ) 0U ) |
| 2980 | { |
| 2981 | /* Move any readied tasks from the pending list into the |
| 2982 | * appropriate ready list. */ |
| 2983 | while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE ) |
| 2984 | { |
| 2985 | pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) ); /*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. */ |
| 2986 | ( void ) uxListRemove( &( pxTCB->xEventListItem ) ); |
| 2987 | ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); |
| 2988 | prvAddTaskToReadyList( pxTCB ); |
| 2989 | |
| 2990 | /* All appropriate tasks yield at the moment a task is added to xPendingReadyList. |
| 2991 | * If the current core yielded then vTaskSwitchContext() has already been called |
| 2992 | * which sets xYieldPendings for the current core to pdTRUE. */ |
| 2993 | } |
| 2994 | |
| 2995 | if( pxTCB != NULL ) |
| 2996 | { |
| 2997 | /* A task was unblocked while the scheduler was suspended, |
| 2998 | * which may have prevented the next unblock time from being |
| 2999 | * re-calculated, in which case re-calculate it now. Mainly |
| 3000 | * important for low power tickless implementations, where |
| 3001 | * this can prevent an unnecessary exit from low power |
| 3002 | * state. */ |
| 3003 | prvResetNextTaskUnblockTime(); |
| 3004 | } |
| 3005 | |
| 3006 | /* If any ticks occurred while the scheduler was suspended then |
| 3007 | * they should be processed now. This ensures the tick count does |
| 3008 | * not slip, and that any delayed tasks are resumed at the correct |
| 3009 | * time. |
no test coverage detected