tinythreadlib::ConditionVariable Class Reference

Condition variable. More...

#include <tinythreadlib.hpp>

List of all members.

Public Member Functions

 ConditionVariable () throw ()
 ~ConditionVariable () throw ()
bool timedWait (Mutex &mutex, unsigned int timeoutMilliseconds) throw ()
void wait (Mutex &mutex) throw ()
void wakeOne () throw ()
void wakeAll () throw ()

Detailed Description

Condition variable.

Represents a condition variable. There are no guarantees regarding fairness! The windows implementation does only use Win32 condition variables if TINYTHREADLIB_ENABLE_VISTA_FEATURES is defined, because these are only available for Windows Vista and later windows versions and not on Windows CE. The windows implementation is using the "The Generation Count Solution" as described in the following article instead: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html.

Definition at line 604 of file tinythreadlib.hpp.


Constructor & Destructor Documentation

tinythreadlib::ConditionVariable::ConditionVariable (  )  throw () [inline]

Create a condition variable.

Definition at line 648 of file tinythreadlib.hpp.

tinythreadlib::ConditionVariable::~ConditionVariable (  )  throw () [inline]

Destroy the condition variable.

Definition at line 672 of file tinythreadlib.hpp.


Member Function Documentation

bool tinythreadlib::ConditionVariable::timedWait ( Mutex mutex,
unsigned int  timeoutMilliseconds 
) throw () [inline]

Wait on the condition variable for the given amount of milliseconds at the most and releases the given mutex temporarily until this method returns. Returns true, if the condition variable was woken and false if the call timed out.

Definition at line 692 of file tinythreadlib.hpp.

void tinythreadlib::ConditionVariable::wait ( Mutex mutex  )  throw () [inline]

Wait on the condition variable and releases the given mutex tmeporarily until this method returns. Returns when the condition variable was woken.

Definition at line 808 of file tinythreadlib.hpp.

void tinythreadlib::ConditionVariable::wakeAll (  )  throw () [inline]

Wakes all waiting threads.

Definition at line 855 of file tinythreadlib.hpp.

void tinythreadlib::ConditionVariable::wakeOne (  )  throw () [inline]

Wake one waiting thread. It is not predictable which waiting thread is actually woken!

Definition at line 827 of file tinythreadlib.hpp.


The documentation for this class was generated from the following file:
 All Classes Files Functions Defines

Generated on Mon Apr 19 22:37:45 2010 for TinyThreadLib by  doxygen 1.6.1