Equivalent code blocks of xSemaphoreTake(xSemaphoreHandle1, 10) ?

Are these two blocks of code equivalent? If not, will you please explain why? Thanks!

Joe

for(;;) {
if(xSemaphoreTake( xSemaphoreHandle1, 10 ) == pdTRUE )
{

    //do work A.

    xSemaphoreGive(xSemaphoreHandle1);
} //if
} compared to for(;;) {
if( xSemaphoreTake( xSemaphoreHandle1, 0 ) == pdTRUE )
{

    //do work A.

    xSemaphoreGive(xSemaphoreHandle1);
}
else
{
    vTaskDelay(10);
}
}

Equivalent code blocks of xSemaphoreTake(xSemaphoreHandle1, 10) ?

The first one will resume the task the moment the Semaphore is given by someone, and then take it, the second will sample the semaphore every 10 ticks and take it if it available, but if it becomes available in the middle of the delay, it will wait till the end of the delay to check.

Equivalent code blocks of xSemaphoreTake(xSemaphoreHandle1, 10) ?

Thanks, Richard. So to be clear, the first one checks to see if the semaphore is available immediately and then checks every tick for 10 more ticks after that (assuming the semaphore is not available), and the second one checks to see if the semaphore is available immedaitely and then only once more after waiting 10 ticks ? Is that right?

Equivalent code blocks of xSemaphoreTake(xSemaphoreHandle1, 10) ?

The first one check the semaphore immediately, and if it is not available, registers the task on the semaphore so that if another task gives the semaphore, it will immediately take it (unless another higher priority task is also waiting on it). It also sets a time to remove it from the wait after 10 ticks.