amino::condition_variable Class Reference

#include <condition.h>

List of all members.

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.


Detailed Description

This is a class which implements Condition variable;

Author:
Zhi Gan(ganzhi@gmail.com)

Member Typedef Documentation


Constructor & Destructor Documentation

amino::condition_variable::condition_variable (  )  [inline]

amino::condition_variable::~condition_variable (  )  [inline]


Member Function Documentation

native_handle_type amino::condition_variable::native_handle (  )  [inline]

template<typename mutexT>
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.

Parameters:
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]

template<typename mutexT>
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

Parameters:
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
Returns:
true if condition vairable is notified. Or false if timout is reached Or false if timout is reached.


The documentation for this class was generated from the following file:

Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6