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

eduardo1966 wrote on Wednesday, April 17, 2019:

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…


rtel wrote on Wednesday, April 17, 2019: