All Classes Namespaces Files Functions Variables Enumerations Enumerator
libs/system/ConditionVariable.h
Go to the documentation of this file.
00001 #ifndef QRK_CONDITION_VARIABLE_H
00002 #define QRK_CONDITION_VARIABLE_H
00003 
00013 #include <memory>
00014 
00015 
00016 namespace qrk
00017 {
00018     class Lock;
00019 
00021     class ConditionVariable
00022     {
00023     public:
00024         enum {
00025             NoTimeout = -1,
00026         };
00027         ConditionVariable(void);
00028         ~ConditionVariable(void);
00029 
00030         bool isWaiting(void);
00031         void wakeup(void);
00032         void wakeupAll(void);
00033 
00034         bool wait(Lock* lock, int timeout = NoTimeout);
00035 
00036     private:
00037         ConditionVariable(const ConditionVariable& rhs);
00038         ConditionVariable& operator = (const ConditionVariable& rhs);
00039 
00040         struct pImpl;
00041         const std::auto_ptr<pImpl> pimpl;
00042     };
00043 }
00044 
00045 #endif /* !QRK_CONDITION_VARIABLE_H */