cheshirekow  v0.1.0
pthreads::Condition Class Reference

Allows multiple threads to wait until a condition is satisfied. More...

#include <cpp_pthreads/condition.h>

Public Member Functions

int broadcast ()
 signals all threads waiting on the condition More...
 
int destroy ()
 destroys a condition variable More...
 
int init ()
 calls initializes a condition variable with default attributes More...
 
int init (const Attr< Condition > &attr)
 initializes a condition variable with the specified attributes More...
 
int signal ()
 signals one thread waiting on the condition More...
 
int wait (Mutex &mutex)
 called by a thread that wishes to wait on this condition More...
 

Private Attributes

pthread_cond_t m_data
 

Detailed Description

Allows multiple threads to wait until a condition is satisfied.

Note
A condition variable is always used with a mutex. When a condition is signaled, one thread that is currently waiting on that condition is woken up, and aquires the mutex that associated with the wait.

Definition at line 44 of file condition.h.

Member Function Documentation

int pthreads::Condition::broadcast ( )

signals all threads waiting on the condition

int pthreads::Condition::destroy ( )

destroys a condition variable

int pthreads::Condition::init ( )

calls initializes a condition variable with default attributes

int pthreads::Condition::init ( const Attr< Condition > &  attr)

initializes a condition variable with the specified attributes

int pthreads::Condition::signal ( )

signals one thread waiting on the condition

int pthreads::Condition::wait ( Mutex mutex)

called by a thread that wishes to wait on this condition

Member Data Documentation

pthread_cond_t pthreads::Condition::m_data
private

Definition at line 46 of file condition.h.


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