Possible bug in xTaskCheckForTimeOut()

In xTaskCheckForTimeOut(), the xTickCount need to be constant so it’s copied into xConstTickCount. But vTaskInternalSetTimeOutState() is called and this function directly use xTickCount instead of xConstTickCount.

The function vTaskInternalSetTimeOutState() is called from a critical section and therefore, tick count cannot change.

Thanks for the answer. I wasn’t correctly understanding the goal of using xConstTickCount. Now i understand that xConstTickCount is used instead of the volatile xTickCount that can’t be optimized by the compiler. So the only drawback of using xTickCount instead of xConstTickCount in vTaskInternalSetTimeOutState() is less optimization.