// Port of pflib/external/openal/CAGuard.h (Apple Core Audio utility class, Playground SDK 4.0): CAGuard, a CAMutex // with a condition variable for signalling; Wait / WaitFor / WaitUntil require the calling thread to own the // guard, release the ownership while waiting and take it back afterwards. CAGuard.cpp is ported next to this file. // Layout from the DWARF of parity-out/sdk/dbgobj/CAGuard.o (size 84): the CAMutex base (+0x00..+0x37), // +0x38 mCondVar. // // The SDK header's nested Locker helper class and its Log_Average_Latency members are not carried (no ported code // uses them). #ifndef CAGUARD_H_INCLUDED #define CAGUARD_H_INCLUDED #include "CAMutex.h" #include #include class CAGuard : public CAMutex { public: CAGuard(const char* inName); virtual ~CAGuard(); virtual void Wait(); virtual bool WaitFor(UInt64 inNanos); virtual bool WaitUntil(UInt64 inNanos); virtual void Notify(); virtual void NotifyAll(); protected: pthread_cond_t mCondVar; }; #endif