|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Unnamed POSIX semaphore (sem_t) shared between threads of one process. More...
#include <Semaphore.hh>
Public Types | |
| enum | semState { EMPTY , FULL } |
| Initial state of the semaphore. More... | |
Public Member Functions | |
| Semaphore (semState initial) | |
| Initialize the semaphore with count 1 for FULL, otherwise 0. | |
| ~Semaphore () | |
| Destroy the semaphore. | |
| void | take () |
| Decrement the semaphore, blocking while it is 0 (sem_wait()). | |
| void | give () |
| Increment the semaphore (sem_post()). | |
Unnamed POSIX semaphore (sem_t) shared between threads of one process.
| Pds::Semaphore::Semaphore | ( | semState | initial | ) |
Initialize the semaphore with count 1 for FULL, otherwise 0.
| Pds::Semaphore::~Semaphore | ( | ) |
Destroy the semaphore.
|
inline |
Increment the semaphore (sem_post()).
|
inline |
Decrement the semaphore, blocking while it is 0 (sem_wait()).