| #if !defined(_concurrency_Monitor_h_) |
| #define _concurrency_Monitor_h_ 1 |
| namespace facebook { namespace thrift { namespace concurrency { |
| /** A monitor is a combination mutex and condition-event. Waiting and notifying condition events requires that the caller own the mutex. Mutex |
| lock and unlock operations can be performed independently of condition events. This is more or less analogous to java.lang.Object multi-thread |
| Note that all methods are const. Monitors implement logical constness, not bit constness. This allows const methods to call monitor |
| methods without needing to cast away constness or change to non-const signatures. |
| virtual void lock() const; |
| virtual void unlock() const; |
| virtual void wait(long long timeout=0LL) const; |
| virtual void notify() const; |
| virtual void notifyAll() const; |
| Synchronized(const Monitor& value) : _monitor(value) { |
| }}} // facebook::thrift::concurrency |
| #endif // !defined(_concurrency_Monitor_h_) |