Implement monitors.
Change-Id: Ifc7a801f9cbcdfbc1e1af5c905261dfadaa60f45
diff --git a/src/mutex.h b/src/mutex.h
index cbfd5a0..43194e9 100644
--- a/src/mutex.h
+++ b/src/mutex.h
@@ -82,6 +82,22 @@
DISALLOW_COPY_AND_ASSIGN(MutexLock);
};
+class ConditionVariable {
+ public:
+ ConditionVariable(const std::string& name);
+ ~ConditionVariable();
+
+ void Broadcast();
+ void Signal();
+ void Wait(Mutex& mutex);
+ void TimedWait(Mutex& mutex, const timespec& ts);
+
+ private:
+ pthread_cond_t cond_;
+ std::string name_;
+ DISALLOW_COPY_AND_ASSIGN(ConditionVariable);
+};
+
} // namespace art
#endif // ART_SRC_MUTEX_H_