How to find if FreeRTOS running? Or simplifying if vTaskStartScheduler() has been called

Hi Some functions of my code are running before FreeRTOS vTaskStartScheduler() is called, and there also called after vTaskStartScheduler(). When FreeRTOS is running is important to provide protection of race conditions so a mutex is used. Of course before calling vTaskStartScheduler() this is not important. Just wonder if there is a function that determine if vTaskStartScheduler() has been called, that is if FreeRTOS is running. I noticed that there is a variable in tasks.c, xSchedulerRunning that seems to do the job, but there is no function that retrieves such variable. There is the matter if there is call to vTaskEndScheduler() (which I don’t do) making the matter more complicated… thanks.

How to find if FreeRTOS running? Or simplifying if vTaskStartScheduler() has been called

https://www.freertos.org/a00021.html#xTaskGetSchedulerState