Honeycomb  0.1
Component-Model Framework
Public Member Functions | List of all members
honey::Condition Class Reference

Method to synchronize threads. Condition variables eliminate the need for repeated polling to check the value of some data. More...

#include <Condition.h>

Inheritance diagram for honey::Condition:
Inheritance graph
[legend]
Collaboration diagram for honey::Condition:
Collaboration graph
[legend]

Public Member Functions

void signal ()
 Signal one waiting thread to resume, resumed thread attempts to acquire the lock. More...
 
void broadcast ()
 Signal all waiting threads to resume, all resumed threads attempt to acquire the lock. More...
 
void wait (UniqueLock< Mutex > &lock)
 Release lock and wait until thread is signaled. More...
 
template<class Rep , class Period >
bool wait (UniqueLock< Mutex > &lock, Duration< Rep, Period > time)
 Release lock and wait until thread is signaled or until an amount of time has passed. Returns true if signaled, false if timed out. More...
 
template<class Clock , class Dur >
bool wait (UniqueLock< Mutex > &lock, TimePoint< Clock, Dur > time)
 Release lock and wait until thread is signaled or until a certain time. Returns true if signaled, false if timed out. More...
 

Detailed Description

Method to synchronize threads. Condition variables eliminate the need for repeated polling to check the value of some data.

The mutex must be locked before calling any methods on the condition.

This is the default condition class that thinly wraps a platform condition. The default condition is fast but can only use a basic mutex.

Member Function Documentation

void honey::Condition::broadcast ( )
inline

Signal all waiting threads to resume, all resumed threads attempt to acquire the lock.

void honey::Condition::signal ( )
inline

Signal one waiting thread to resume, resumed thread attempts to acquire the lock.

void honey::Condition::wait ( UniqueLock< Mutex > &  lock)
inline

Release lock and wait until thread is signaled.

template<class Rep , class Period >
bool honey::Condition::wait ( UniqueLock< Mutex > &  lock,
Duration< Rep, Period >  time 
)
inline

Release lock and wait until thread is signaled or until an amount of time has passed. Returns true if signaled, false if timed out.

template<class Clock , class Dur >
bool honey::Condition::wait ( UniqueLock< Mutex > &  lock,
TimePoint< Clock, Dur >  time 
)
inline

Release lock and wait until thread is signaled or until a certain time. Returns true if signaled, false if timed out.


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