#include <condition.h>
Public Types | |
typedef pthread_cond_t | native_handle_type |
Public Member Functions | |
condition_variable () | |
~condition_variable () | |
native_handle_type | native_handle () |
template<typename mutexT> | |
void | wait (unique_lock< mutexT > &lock) |
block current thread until notification is fired by other threads. | |
void | notify_one () |
void | notify_all () |
template<typename mutexT> | |
bool | timed_wait (unique_lock< mutexT > &lock, long milli) |
block current thread until notification is fired by other threads. |
typedef pthread_cond_t amino::condition_variable::native_handle_type |
amino::condition_variable::condition_variable | ( | ) | [inline] |
amino::condition_variable::~condition_variable | ( | ) | [inline] |
native_handle_type amino::condition_variable::native_handle | ( | ) | [inline] |
void amino::condition_variable::wait | ( | unique_lock< mutexT > & | lock | ) | [inline] |
block current thread until notification is fired by other threads.
Before calling wait(long) function, thread must already hold the mutex specified in argument.
lock | An lock which is alread hold by current thread. This lock will be released when thread is blocked waiting. And it will be re-acquired after the wait is finished. |
void amino::condition_variable::notify_one | ( | ) | [inline] |
void amino::condition_variable::notify_all | ( | ) | [inline] |
bool amino::condition_variable::timed_wait | ( | unique_lock< mutexT > & | lock, | |
long | milli | |||
) | [inline] |
block current thread until notification is fired by other threads.
Before calling timed_wait(long) fucntion, thread must already acquired the mutex
lock | An lock which is alread hold by current thread. This lock will be released when thread is blocked waiting. And it will be re-acquired after the wait is finished. | |
milli | time in milliseconds to wait until notified |