Hi,
How is a binary semaphore created? I can't find it documented or in the header comments.
Thansk,
-Mike
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
How is a binary semaphore created? I can't find it documented or in the header comments.
Thansk,
-Mike
What version of BIOS are you using?
Are you tring to create the semaphore at config time or at run time?
Hi Mike,
All the logic for a binary semaphore is in the pendBinary and postBinary. The create for a binary semaphore is the same as a counting one (e.g. SEM_create). However, make sure you set the count to zero or one. Now just use the pendBinary/postBinary functions.
When dealing with a specific semaphore handle, do not mix and match the binary pend/post functions with the standard counting pend/post functions. As expected, this gives undeterministic results.
Todd
You will create a binary semaphore using SEM_create(), just like you would use with a counting semaphore. The initial semaphore count will be either 1 or 0, depending on your needs. You can then use the SEM_pendBinary() and SEM_postBinary() calls to wait for and signal the semaphore.
Dave