# When xSemphoareGive() pdFAIL

**URL:** <https://forums.freertos.org/t/when-xsemphoaregive-pdfail/6949>\
**Category:** Kernel\
**Created:** [January 23, 2018, 10:49am UTC](https://forums.freertos.org/t/when-xsemphoaregive-pdfail/6949 "2018-01-23T10:49:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 23, 2018, 10:49am UTC](https://forums.freertos.org/t/when-xsemphoaregive-pdfail/6949/1 "2018-01-23T10:49:50Z")

</div>

**[biosjimmy](https://sourceforge.net/u/biosjimmy/)** wrote on [Tuesday, January 23, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/f0277015/#126f):

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?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 23, 2018, 4:03pm UTC](https://forums.freertos.org/t/when-xsemphoaregive-pdfail/6949/2 "2018-01-23T16:03:07Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, January 23, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/f0277015/#6168):

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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 24, 2018, 5:24am UTC](https://forums.freertos.org/t/when-xsemphoaregive-pdfail/6949/3 "2018-01-24T05:24:56Z")

</div>

**[biosjimmy](https://sourceforge.net/u/biosjimmy/)** wrote on [Wednesday, January 24, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/f0277015/#f396):

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

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