#include <MTsync.hh>
Public Methods | |
Condvar_ () | |
Init to default. | |
~Condvar_ () | |
dtor. | |
void | reset () |
reset(): sets the Signal to false. | |
void | wait () |
wait(): locks the associated mutex, reads the condition variable, then unlocks Mutex and starts waiting on the condition. | |
void | timed_wait (long Sec, long Nanosec) |
timed_wait(Sec, Nanosec): does the same as wait() but times out after Sec seconds and Nanosec nanoseconds have elapsed. | |
void | signal () |
signal(): indicates that the condition is fulfilled and one thread waiting on the condition variable can be unblocked. | |
void | broadcast () |
broadcast(): indicates that the condition is fulfilled and all threads waiting on the condition variable may be unblocked. | |
Private Methods | |
Condvar_ (const Condvar_ &) | |
Condvar_& | operator= (const Condvar_ &) |
Private Attributes | |
pthread_cond_t | Cond |
the condition variable. | |
pthread_mutex_t | Mtx |
the associated mutex. | |
bool | Signal |
true if somebody signalled. |
Definition at line 87 of file MTsync.hh.
|
Init to default.
|
|
dtor.
|
|
|
|
reset(): sets the Signal to false.
|
|
wait(): locks the associated mutex, reads the condition variable, then unlocks Mutex and starts waiting on the condition.
|
|
timed_wait(Sec, Nanosec): does the same as wait() but times out after Sec seconds and Nanosec nanoseconds have elapsed.
|
|
signal(): indicates that the condition is fulfilled and one thread waiting on the condition variable can be unblocked.
|
|
broadcast(): indicates that the condition is fulfilled and all threads waiting on the condition variable may be unblocked.
|
|
|
|
the condition variable.
|
|
the associated mutex.
|
|
true if somebody signalled.
|