41 #if !defined(__CAGuard_h__)
67 class CAGuard :
public CAMutex
72 CAGuard(
const char* inName);
78 virtual bool WaitFor(UInt64 inNanos);
79 virtual bool WaitUntil(UInt64 inNanos);
81 virtual void Notify();
82 virtual void NotifyAll();
87 pthread_cond_t mCondVar;
91 #if Log_Average_Latency
92 Float64 mAverageLatencyAccumulator;
93 UInt32 mAverageLatencyCount;
103 Locker(CAGuard& inGuard) : mGuard(inGuard), mNeedsRelease(false) { mNeedsRelease = mGuard.Lock(); }
104 ~Locker() {
if(mNeedsRelease) { mGuard.Unlock(); } }
107 Locker(
const Locker&);
108 Locker& operator=(
const Locker&);
112 void Wait() { mGuard.Wait(); }
113 bool WaitFor(UInt64 inNanos) {
return mGuard.WaitFor(inNanos); }
114 bool WaitUntil(UInt64 inNanos) {
return mGuard.WaitUntil(inNanos); }
116 void Notify() { mGuard.Notify(); }
117 void NotifyAll() { mGuard.NotifyAll(); }