Is uxTaskGetStackHighWaterMark() preemptible?

alessandro1963 wrote on Tuesday, June 30, 2015:

Hello everybody,
I have a low-priority task that periodically checks the other tasks’ stack usage by means of uxTaskGetStackHighWaterMark(). Is this function preemptible by the FreeRTOS scheduler? In other words, can the higher priority tasks run without having to wait for uxTaskGetStackHighWaterMark() to complete (causing a kind of priority inversion situation)? I checked the code and I didn’t see any ENTER_CRITICAL … EXIT_CRITICAL sections, so I assume that uxTaskGetStackHighWaterMark() can be preempted by the scheduler, but I just want to make sure.

Thank you

rtel wrote on Tuesday, June 30, 2015:

I’ve just looked at the code and cannot see any reason why the functionality is not thread safe - so yes the functions can be pre-empted by higher priority tasks but that should not cause you a problem.


alessandro1963 wrote on Tuesday, June 30, 2015:

Thank you very much for your quick reply.

Best Regards