rtel wrote on Thursday, January 19, 2012:
You are looking at the implementation of an API function - which is fine if you are doing that out of curiosity or want to know how FreeRTOS works. If on the other hand you are just wanting to use FreeRTOS, then you only need to know the behaviour of the API function, and not how it implements that behavior.
If a task calls xQueueReceive() with a block time, then the time at which the task should unblock if there is no data to receive is calculated at the time xQueueReceive() is called - and that value cannot be changed after the function has been called. The manipulation of xTicksToWait in the function implementation ensures that behaviour is correct - it does not effect the time at which the task unblocks.