From 0df4e80b9756d26894e01e926b6179e17dd5180f Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Mon, 27 Sep 2021 23:20:27 +0800 Subject: [PATCH] freertos: Fix prvTaskIsTaskSuspended check This commit fixes prvTaskIsTaskSuspended(). Both pending ready lists should be checked to confirm that is truly suspended. Closes https://github.com/espressif/esp-idf/issues/7564 --- components/freertos/tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index d57a6e6d88..89844b908f 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -2093,7 +2093,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB, if( listIS_CONTAINED_WITHIN( &xSuspendedTaskList, &( pxTCB->xStateListItem ) ) != pdFALSE ) { /* Has the task already been resumed from within an ISR? */ - if( listIS_CONTAINED_WITHIN( &xPendingReadyList[xPortGetCoreID()], &( pxTCB->xEventListItem )) || + if( listIS_CONTAINED_WITHIN( &xPendingReadyList[xPortGetCoreID()], &( pxTCB->xEventListItem )) == pdFALSE && listIS_CONTAINED_WITHIN( &xPendingReadyList[!xPortGetCoreID()], &( pxTCB->xEventListItem )) == pdFALSE ) { /* Is it in the suspended list because it is in the Suspended