Simple Semaphore implementation wrapping the standard linux "sem_t"-struct.
More...
#include <Semaphore.h>
Simple Semaphore implementation wrapping the standard linux "sem_t"-struct.
◆ Semaphore()
icl::utils::Semaphore::Semaphore |
( |
int |
n = 1 | ) |
|
create a semaphore initialized with n resources
◆ acquire()
void icl::utils::Semaphore::acquire |
( |
int |
val = 1 | ) |
|
|
inline |
◆ getMaxValue()
int icl::utils::Semaphore::getMaxValue |
( |
| ) |
|
returns the semaphores max-value
◆ getValue()
int icl::utils::Semaphore::getValue |
( |
| ) |
|
returns the current value
◆ operator++()
void icl::utils::Semaphore::operator++ |
( |
int |
dummy | ) |
|
◆ operator+=()
void icl::utils::Semaphore::operator+= |
( |
int |
val | ) |
|
◆ operator--()
void icl::utils::Semaphore::operator-- |
( |
int |
dummy | ) |
|
◆ operator-=()
void icl::utils::Semaphore::operator-= |
( |
int |
val | ) |
|
◆ release()
void icl::utils::Semaphore::release |
( |
int |
val = 1 | ) |
|
|
inline |
◆ tryAcquire()
bool icl::utils::Semaphore::tryAcquire |
( |
| ) |
|
trys to acquire one resource if successfull it returns true else false
◆ tryRelease()
bool icl::utils::Semaphore::tryRelease |
( |
| ) |
|
releases one resource only if resources are aqcuired
The documentation for this class was generated from the following file:
- /Users/alneuman/vm/icl/ICLUtils/src/ICLUtils/Semaphore.h