#include ConditionVariable::ConditionVariable(void ) { pthread_cond_init( &cond_var, NULL); pthread_mutex_init( &mutex_var, NULL); } ConditionVariable::~ConditionVariable() { pthread_cond_destroy( &cond_var); } // Wait on a condition variable int ConditionVariable::Wait(void) { return pthread_cond_wait( &cond_var, &mutex_var); } // Signal all threads waiting on a condition variable int ConditionVariable::Signal(void) { return pthread_cond_signal( &cond_var); }