# When xSemphoareGive() pdFAIL

biosjimmy wrote on Tuesday, January 23, 2018:

I am a little confused on calling xSemaphoreGive returns pdFAIL.

In the FreeRTOS Reference Manual,

xSemaphoreGive( SemaphoreHandle_t xSemaphore );

Return Values:

pdFAIL: The semaphore ‘give’ operation was not successful because the task calling xSemaphoreGive() is not the semaphore holder.

Does this mean,

if the task calling xSemaphoreGive() is not the same task calling xSemaphoreTake(),
xSemaphoreGive() returns pdFAIL?

rtel wrote on Tuesday, January 23, 2018:

That is probably only right in the case of a mutex. Where is the text you are quoting found? pdf reference manual, online or in the book? I will check it, it might be wrong.

biosjimmy wrote on Wednesday, January 24, 2018:

Thanks for the reply. This is what I thought too, mutex only.

The quoting is from the PDF version of The FreeRTOS™ Reference Manual.