My Project
|
cross platform condition variable. More...
#include <Semaphore.hpp>
Public Member Functions | |
Semaphore (int in_init=0) | |
Constructor. More... | |
Semaphore (const Semaphore &in_sem) | |
Copy constructor. More... | |
void | operator= (const Semaphore &in_sem) |
Copy method. More... | |
virtual | ~Semaphore () |
destroy semaphore | |
bool | wait () const |
Wait until the semaphore is called by another thread. More... | |
bool | post () |
post a token More... | |
int | value () const |
get current value More... | |
void | reset (int in_init=0) |
release current semaphore and create a new one More... | |
Protected Attributes | |
sem_t | _sem |
Posix semaphore. | |
cross platform condition variable.
This class represent a simple way to use semaphore
|
inline |
Constructor.
in_init | original value |
|
inline |
Copy constructor.
in_sem | original semaphore |
|
inline |
Copy method.
in_sem | original semaphore |
|
inline |
post a token
|
inline |
release current semaphore and create a new one
init | the value after reset |
|
inline |
get current value
|
inline |
Wait until the semaphore is called by another thread.