class Condition3 : public ConditionBase { public: Condition3() : signal_(false) { } void wait() { pthread_mutex_lock(&mutex_); if (!signal_) { pthread_cond_wait(&cond_, &mutex_); } signal_ = false; pthread_mutex_unlock(&mutex_); } void wakeup() { pthread_mutex_lock(&mutex_); signal_ = true; pthread_cond_signal(&cond_); pthread_mutex_unlock(&mutex_); } private: bool signal_; };