Lunchbox  1.4.0
Public Member Functions
lunchbox::Condition Class Reference

A condition variable and associated lock. More...

#include <condition.h>

List of all members.

Public Member Functions

 Condition ()
 Construct a new condition variable.
 ~Condition ()
 Destruct this condition variable.
void lock ()
 Lock the mutex.
void unlock ()
 Unlock the mutex.
void signal ()
 Signal the condition.
void broadcast ()
 Broadcast the condition.
void wait ()
 Atomically unlock the mutex, wait for a signal and relock the mutex.
bool timedWait (const uint32_t timeout)
 Atomically unlock the mutex, wait for a signal and relock the mutex.

Detailed Description

A condition variable and associated lock.

Follows closely pthread_condition and mutex

Definition at line 32 of file condition.h.


Constructor & Destructor Documentation

Construct a new condition variable.

Version:
1.0

Destruct this condition variable.

Version:
1.0

Member Function Documentation

Broadcast the condition.

Version:
1.0

Referenced by lunchbox::Monitor< T >::operator++(), lunchbox::Monitor< T >::operator--(), lunchbox::Monitor< T >::operator|=(), and lunchbox::Monitor< T >::set().

+ Here is the caller graph for this function:

bool lunchbox::Condition::timedWait ( const uint32_t  timeout)

Atomically unlock the mutex, wait for a signal and relock the mutex.

The operation is aborted after the given timeout and false is returned.

Parameters:
timeoutthe timeout in milliseconds to wait for the signal.
Returns:
true on success, false on timeout.
Version:
1.0

Referenced by lunchbox::MTQueue< T, S >::timedPop(), lunchbox::Monitor< T >::timedWaitEQ(), lunchbox::Monitor< T >::timedWaitGE(), and lunchbox::Monitor< T >::timedWaitNE().

+ Here is the caller graph for this function:


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