From 6f0604699835f3367f654783e9afc18193b13ae4 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Sat, 21 Dec 2024 11:50:09 -0500 Subject: [PATCH] Update core ID before getting locks in prvCheckForRunStateChange() --- tasks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index bd19bbc27..5d030258f 100644 --- a/tasks.c +++ b/tasks.c @@ -853,9 +853,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; * its run state. */ portDISABLE_INTERRUPTS(); + + xCoreID = ( BaseType_t ) portGET_CORE_ID(); portGET_TASK_LOCK( xCoreID ); portGET_ISR_LOCK( xCoreID ); - xCoreID = ( BaseType_t ) portGET_CORE_ID(); portSET_CRITICAL_NESTING_COUNT( xCoreID, uxPrevCriticalNesting );