A POSIX semaphore.
More...
#include <ThreadSupport.h>
|
| Semaphore () |
| Constructor.
|
|
| ~Semaphore () |
| Destructor.
|
|
void | wait () throw () |
| Suspend calling thread until the semaphore has a non-zero count.
|
|
bool | check () throw () |
| Do a non-blocking wait on the Semaphore.
|
|
void | post () throw () |
| Atomically increment the Semaphore.
|
|
int | getValue () throw () |
| Get the current value of the Semaphore.
|
|
sem_t * | ptr () |
| Get the pointer to the semaphore (for legacy C code).
|
|
◆ Semaphore() [1/2]
nidas::util::Semaphore::Semaphore |
( |
| ) |
|
|
inline |
Constructor.
References _sem.
◆ ~Semaphore()
nidas::util::Semaphore::~Semaphore |
( |
| ) |
|
|
inline |
Destructor.
References _sem.
◆ Semaphore() [2/2]
nidas::util::Semaphore::Semaphore |
( |
const Semaphore & | | ) |
|
|
private |
◆ check()
bool nidas::util::Semaphore::check |
( |
| ) |
|
throw | ( | ) | | | |
|
inline |
Do a non-blocking wait on the Semaphore.
- Returns
- true Semaphore had a non-zero count, which was decremented. false Semaphore was zero. Not changed.
References _sem.
◆ getValue()
int nidas::util::Semaphore::getValue |
( |
| ) |
|
throw | ( | ) | | | |
|
inline |
◆ operator=()
◆ post()
void nidas::util::Semaphore::post |
( |
| ) |
|
throw | ( | ) | | | |
|
inline |
◆ ptr()
sem_t * nidas::util::Semaphore::ptr |
( |
| ) |
|
|
inline |
Get the pointer to the semaphore (for legacy C code).
References _sem.
◆ wait()
void nidas::util::Semaphore::wait |
( |
| ) |
|
throw | ( | ) | | | |
|
inline |
Suspend calling thread until the semaphore has a non-zero count.
Then atomically decrement the semaphore count and return;
References _sem.
◆ _sem
sem_t nidas::util::Semaphore::_sem |
|
private |
The documentation for this class was generated from the following file: