Equalizer 1.0

co::base::Condition Class Reference

A condition variable and associated lock. More...

#include <condition.h>

List of all members.

Public Member Functions

COBASE_API Condition ()
 Construct a new condition variable.
COBASE_API ~Condition ()
 Destruct this condition variable.
COBASE_API void lock ()
 Lock the mutex.
COBASE_API void unlock ()
 Unlock the mutex.
COBASE_API void signal ()
 Signal the condition.
COBASE_API void broadcast ()
 Broadcast the condition.
COBASE_API void wait ()
 Atomically unlock the mutex, wait for a signal and relock the mutex.
bool timedWait (const unsigned 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 34 of file condition.h.


Constructor & Destructor Documentation

COBASE_API co::base::Condition::Condition ( )

Construct a new condition variable.

Version:
1.0
COBASE_API co::base::Condition::~Condition ( )

Destruct this condition variable.

Version:
1.0

Member Function Documentation

COBASE_API void co::base::Condition::broadcast ( )

Broadcast the condition.

Version:
1.0

Referenced by co::base::Monitor< State >::operator++(), co::base::Monitor< State >::operator--(), co::base::Monitor< State >::operator|=(), and co::base::Monitor< State >::set().

Here is the caller graph for this function:

COBASE_API void co::base::Condition::signal ( )

Signal the condition.

Version:
1.0

Referenced by co::base::MTQueue< Command * >::operator=(), co::base::MTQueue< Command * >::push(), and co::base::MTQueue< Command * >::pushFront().

Here is the caller graph for this function:

bool co::base::Condition::timedWait ( const unsigned  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
COBASE_API void co::base::Condition::wait ( )

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

Version:
1.0

Referenced by co::base::MTQueue< Command * >::pop(), co::base::Monitor< State >::waitEQ(), co::base::Monitor< State >::waitGE(), co::base::Monitor< State >::waitLE(), co::base::Monitor< State >::waitNE(), and co::base::MTQueue< Command * >::waitSize().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:08 for Equalizer 1.0 by  doxygen 1.7.3