libpsynth 0.2.1
Public Member Functions
psynth::condition Class Reference

Condition variable. More...

#include <mutex.hpp>

List of all members.

Public Member Functions

 condition ()
 Constructor.
 ~condition ()
 Destructor.
void broadcast () const
 Restarts threads that are waiting on the condition variable.
void signal () const
 Restarts one thread that is waiting on the condition variable.
void wait (mutex &mutex) const
 Starts waiting on the condition.
bool timed_wait (mutex &mutex, const timespec &abstime) const
 Waits until the condition is signaled or the time has expired.

Detailed Description

Condition variable.


Constructor & Destructor Documentation

psynth::condition::condition ( ) [inline]

Constructor.

psynth::condition::~condition ( ) [inline]

Destructor.


Member Function Documentation

void psynth::condition::broadcast ( ) const [inline]

Restarts threads that are waiting on the condition variable.

void psynth::condition::signal ( ) const [inline]

Restarts one thread that is waiting on the condition variable.

bool psynth::condition::timed_wait ( mutex mutex,
const timespec &  abstime 
) const [inline]

Waits until the condition is signaled or the time has expired.

Parameters:
mutexThe mutex for the synchronization protocol, used in the same way as in wait.
abstimeThe maximum time to wait.
Returns:
True if the mutex was signaled during the wait or false if we returned because of a timeout.
See also:
wait
void psynth::condition::wait ( mutex mutex) const [inline]

Starts waiting on the condition.

First it unlocks the mutex -which must be previously locked- and blocks on the condition until it is signaled. The mutex is locked again before returning.

Parameters:
mutexA lock.

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