File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3208,6 +3208,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
32083208
32093209 #if ( configNUMBER_OF_CORES == 1 )
32103210 {
3211+ UBaseType_t uxCurrentListLength ;
3212+
32113213 if ( xSchedulerRunning != pdFALSE )
32123214 {
32133215 /* Reset the next expected unblock time in case it referred to the
@@ -3236,7 +3238,13 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
32363238 /* The scheduler is not running, but the task that was pointed
32373239 * to by pxCurrentTCB has just been suspended and pxCurrentTCB
32383240 * must be adjusted to point to a different task. */
3239- if ( listCURRENT_LIST_LENGTH ( & xSuspendedTaskList ) == uxCurrentNumberOfTasks )
3241+
3242+ /* Use a temp variable as a distinct sequence point for reading
3243+ * volatile variables prior to a comparison to ensure compliance
3244+ * with MISRA C 2012 Rule 13.2. */
3245+ uxCurrentListLength = listCURRENT_LIST_LENGTH ( & xSuspendedTaskList );
3246+
3247+ if ( uxCurrentListLength == uxCurrentNumberOfTasks )
32403248 {
32413249 /* No other tasks are ready, so set pxCurrentTCB back to
32423250 * NULL so when the next task is created pxCurrentTCB will
You can’t perform that action at this time.
0 commit comments