|
libpsynth 0.2.1
|
Condition variable. More...
#include <mutex.hpp>
Public Member Functions | |
| condition () | |
| Constructor. | |
| ~condition () | |
| Destructor. | |
| void | broadcast () const |
| Restarts threads that are waiting on the condition variable. | |
| void | signal () const |
| Restarts one thread that is waiting on the condition variable. | |
| void | wait (mutex &mutex) const |
| Starts waiting on the condition. | |
| bool | timed_wait (mutex &mutex, const timespec &abstime) const |
| Waits until the condition is signaled or the time has expired. | |
Condition variable.
| psynth::condition::condition | ( | ) | [inline] |
Constructor.
| psynth::condition::~condition | ( | ) | [inline] |
Destructor.
| void psynth::condition::broadcast | ( | ) | const [inline] |
Restarts threads that are waiting on the condition variable.
| void psynth::condition::signal | ( | ) | const [inline] |
Restarts one thread that is waiting on the condition variable.
| bool psynth::condition::timed_wait | ( | mutex & | mutex, |
| const timespec & | abstime | ||
| ) | const [inline] |
Waits until the condition is signaled or the time has expired.
| mutex | The mutex for the synchronization protocol, used in the same way as in wait. |
| abstime | The maximum time to wait. |
| void psynth::condition::wait | ( | mutex & | mutex | ) | const [inline] |
Starts waiting on the condition.
First it unlocks the mutex -which must be previously locked- and blocks on the condition until it is signaled. The mutex is locked again before returning.
| mutex | A lock. |
1.7.4