@@ -2566,6 +2566,15 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
2566
2566
uxTask += prvListTasksWithinSingleList ( & ( pxTaskStatusArray [ uxTask ] ), & ( pxReadyTasksLists [ uxQueue ] ), eReady );
2567
2567
} while ( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
2568
2568
2569
+ /* Fill in an TaskStatus_t structure with information on each
2570
+ * task in the pending ready list. Tasks in pending ready list are
2571
+ * in eReady state. */
2572
+ taskENTER_CRITICAL ();
2573
+ {
2574
+ uxTask += prvListTasksWithinSingleList ( & ( pxTaskStatusArray [ uxTask ] ), & xPendingReadyList , eReady );
2575
+ }
2576
+ taskEXIT_CRITICAL ();
2577
+
2569
2578
/* Fill in an TaskStatus_t structure with information on each
2570
2579
* task in the Blocked state. */
2571
2580
uxTask += prvListTasksWithinSingleList ( & ( pxTaskStatusArray [ uxTask ] ), ( List_t * ) pxDelayedTaskList , eBlocked );
@@ -3874,7 +3883,6 @@ static void prvCheckTasksWaitingTermination( void )
3874
3883
/*-----------------------------------------------------------*/
3875
3884
3876
3885
#if ( configUSE_TRACE_FACILITY == 1 )
3877
-
3878
3886
static UBaseType_t prvListTasksWithinSingleList ( TaskStatus_t * pxTaskStatusArray ,
3879
3887
List_t * pxList ,
3880
3888
eTaskState eState )
@@ -3894,8 +3902,26 @@ static void prvCheckTasksWaitingTermination( void )
3894
3902
do
3895
3903
{
3896
3904
listGET_OWNER_OF_NEXT_ENTRY ( pxNextTCB , pxList ); /*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. */
3897
- vTaskGetInfo ( ( TaskHandle_t ) pxNextTCB , & ( pxTaskStatusArray [ uxTask ] ), pdTRUE , eState );
3898
- uxTask ++ ;
3905
+
3906
+ /* Tasks in pending ready list are in eReady state regardless of
3907
+ * what list the task's state list item is currently placed on.
3908
+ * Thus, these tasks can be enumerated in this function directly. */
3909
+ if ( pxList == & xPendingReadyList )
3910
+ {
3911
+ vTaskGetInfo ( ( TaskHandle_t ) pxNextTCB , & ( pxTaskStatusArray [ uxTask ] ), pdTRUE , eState );
3912
+ uxTask ++ ;
3913
+ }
3914
+ else
3915
+ {
3916
+ /* Tasks may be in pending ready list and other state list at
3917
+ * the same time. These tasks should be enumuerated in xPendingReadyList
3918
+ * only. */
3919
+ if ( listIS_CONTAINED_WITHIN ( & xPendingReadyList , & ( pxNextTCB -> xEventListItem ) ) == pdFALSE )
3920
+ {
3921
+ vTaskGetInfo ( ( TaskHandle_t ) pxNextTCB , & ( pxTaskStatusArray [ uxTask ] ), pdTRUE , eState );
3922
+ uxTask ++ ;
3923
+ }
3924
+ }
3899
3925
} while ( pxNextTCB != pxFirstTCB );
3900
3926
}
3901
3927
else
0 commit comments