Cyg_Binary_Semaphore::Cyg_Binary_Semaphore
Name: Cyg_Binary_Semaphore::Cyg_Binary_Semaphore ( ) - create a binary semaphore
Synopsis:
Cyg_Binary_Semaphore::Cyg_Binary_Semaphore
(
  cyg_bool init_state = false  /* initial state */
)
Description: Creates a binary semaphore. Posting a binary semaphore that is already available will remain available, it will not affect its count.

An initial state of "true" means the binary semaphore was created as not taken (free to be taken by any thread) and a state of "false" means the binary semaphore was created as being taken.

Include: #include <cyg/kernel/sema.hxx>
Returns: nothing
See Also: Cyg_Binary_Semaphore::~Cyg_Binary_Semaphore

Cyg_Binary_Semaphore::~Cyg_Binary_Semaphore
Name: Cyg_Binary_Semaphore::~Cyg_Binary_Semaphore ( ) - destroy a binary semaphore
Synopsis:
Cyg_Binary_Semaphore::~Cyg_Binary_Semaphore
(
  void
)
Description: Destroys a binary semaphore. This will NOT release threads waiting on the binary semaphore, it will simply call the destructor which essentially does nothing but free the memory. Be certain that the semaphore is available before destroying it.
Include: #include <cyg/kernel/sema.hxx>
Returns: nothing
See Also: Cyg_Binary_Semaphore::Cyg_Binary_Semaphore

Cyg_Binary_Semaphore::wait
Name: Cyg_Binary_Semaphore::wait ( ) - get a binary semaphore
Synopsis:
cyg_bool Cyg_Binary_Semaphore::wait
(
  void
)
Description: Takes a binary semaphore. If the binary semaphore is not available this will block until the binary semaphore is available.
Include: #include <cyg/kernel/sema.hxx>
Returns: "true" is the binary semaphore was taken, "false" if the binary semaphore could not be taken. The value of "false" will be returned if the thread is awaken. See the thread api.
See Also: Cyg_Binary_Semaphore::trywait, Cyg_Binary_Semaphore::post, Cyg_Binary_Semaphore::posted

Cyg_Binary_Semaphore::trywait
Name: Cyg_Binary_Semaphore::trywait ( ) - get a binary semaphore, don't block
Synopsis:
cyg_bool Cyg_Binary_Semaphore::trywait
(
  void
)
Description: Takes a binary semaphore but only if it is currently available. If the binary semaphore has already been taken by another thread this will return "false".
Include: #include <cyg/kernel/sema.hxx>
Returns: "true" if the semaphore was taken by the calling thread, "false" if the semaphore was already taken by a thread.
See Also: Cyg_Binary_Semaphore::wait, Cyg_Binary_Semaphore::post, Cyg_Binary_Semaphore::posted

Cyg_Binary_Semaphore::post
Name: Cyg_Binary_Semaphore::post ( ) - release a binary semaphore
Synopsis:
void Cyg_Binary_Semaphore::post
(
  void
)
Description: This will release a binary semaphore. If the binary semaphore is already released, calling this will have no affect on the binary semaphore. Unlike a mutex, a binary semaphore can be released by any thread, not just the thread that allocated it.
Include: #include <cyg/kernel/sema.hxx>
Returns: nothing
See Also: Cyg_Binary_Semaphore::wait, Cyg_Binary_Semaphore::trywait, Cyg_Binary_Semaphore::posted

Cyg_Binary_Semaphore::posted
Name: Cyg_Binary_Semaphore::posted ( ) - check availability of a binary semaphore
Synopsis:
cyg_bool Cyg_Binary_Semaphore::posted
(
  void
)
Description: This reports the status of a binary semaphore.
Include: #include <cyg/kernel/sema.hxx>
Returns: "true" if the binary semaphore is available "false" if a thread has allocated it already.
See Also: Cyg_Binary_Semaphore::wait, Cyg_Binary_Semaphore::trywait, Cyg_Binary_Semaphore::post