File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1361,7 +1361,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
1361
1361
eTaskState eTaskGetState ( TaskHandle_t xTask )
1362
1362
{
1363
1363
eTaskState eReturn ;
1364
- List_t const * pxStateList , * pxDelayedList , * pxOverflowedDelayedList ;
1364
+ List_t const * pxStateList , * pxEventList , * pxDelayedList , * pxOverflowedDelayedList ;
1365
1365
const TCB_t * const pxTCB = xTask ;
1366
1366
1367
1367
configASSERT ( pxTCB );
@@ -1376,12 +1376,21 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
1376
1376
taskENTER_CRITICAL ();
1377
1377
{
1378
1378
pxStateList = listLIST_ITEM_CONTAINER ( & ( pxTCB -> xStateListItem ) );
1379
+ pxEventList = listLIST_ITEM_CONTAINER ( & ( pxTCB -> xEventListItem ) );
1379
1380
pxDelayedList = pxDelayedTaskList ;
1380
1381
pxOverflowedDelayedList = pxOverflowDelayedTaskList ;
1381
1382
}
1382
1383
taskEXIT_CRITICAL ();
1383
1384
1384
- if ( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
1385
+ if ( pxEventList == & xPendingReadyList )
1386
+ {
1387
+ /* The task has been placed on the pending ready list, so its
1388
+ * state is eReady regardless of what list the task's state list
1389
+ * item is currently placed on. */
1390
+ eReturn = eReady ;
1391
+ }
1392
+
1393
+ else if ( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )
1385
1394
{
1386
1395
/* The task being queried is referenced from one of the Blocked
1387
1396
* lists. */
You can’t perform that action at this time.
0 commit comments