diff --git a/tasks.c b/tasks.c index 1046791a4..735b79974 100644 --- a/tasks.c +++ b/tasks.c @@ -2636,7 +2636,9 @@ BaseType_t xYieldOccurred; /* Use xPendedTicks to mimic xTicksToCatchUp number of ticks occurring when the scheduler is suspended so the ticks are executed in xTaskResumeAll(). */ vTaskSuspendAll(); + taskENTER_CRITICAL(); xPendedTicks += xTicksToCatchUp; + taskEXIT_CRITICAL(); xYieldOccurred = xTaskResumeAll(); return xYieldOccurred;