From c33b260e7a9659f5af55a2e78d74f9cfd09bbd44 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Fri, 24 Dec 2021 21:08:56 +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 23c38521e6..d2f67d4724 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -2026,7 +2026,7 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB, TaskFunction_t pxTaskCode 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