I have a question on freeRTOS semaphore function:
freeRTOS document says: "A block time of zero can be used to poll the semaphore".
My question is what does the block time means and what happens after block time expires. There are two understandings:
1. The block time means the time period for task to poll the semaphore state. So after block time expires, the task continue to check if semaphore is available. If not, then task will check again after next block time expires.
2. The block is the max time task being block if the semaphore is not available. After block time expires, task will start to execute next instruction even if semaphore is not available.
Which understanding is correct?
if first understanding is correct, when using
xSemaphoreTake( xSemaphore, ( portTickType ) 0 ) in one of my task and the semaphore/mutex is not available for a long time, I guess the task being block continue to run trying to poll semaphore state? If so, will lower priority task be block? This seems to defeat the purpose of using semaphore.