mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
FreeRTOS uses a single "xSchedulerRunning" variable to tack whether the scheduler has started, and this variable is set to "pdTRUE" by core 0 via calling vTaskStartScheduler(). However, with SMP FreeRTOS, there is a race condition where core 0 has already started the scheduler and another core has not called xPortStartScheduler() yet and calls some FreeRTOS API. Thus the resultant FreeRTOS API can cause errors as it thinks the scheduler has started. This commit adds a temporary workaround (by having each core maintain their own "xSchedulerRunning" variable.