class ConditionBase { public: ConditionBase() { pthread_mutex_init(&mutex_, NULL); pthread_cond_init(&cond_, NULL); } ~ConditionBase() { pthread_mutex_destroy(&mutex_); pthread_cond_destroy(&cond_); } private: pthread_mutex_t mutex_; pthread_cond_t cond_; };