// PThreadConditionLocker.h #ifndef dset__PThreadConditionLocker_H #define dset__PThreadConditonLocker_H // Class that locks a PThreadConditionx upon construction and then // unlocks it and broadcasts a signal during destruction. // // Throws an assertion if the condition mutex is found to be locked // during construction. #include "dataset_util/PThreadCondition.h" class PThreadConditionLocker { private: // data PThreadCondition* m_pmtx; private: // Hide copy and assignment. // Copy. PThreadConditionLocker(const PThreadConditionLocker& rhs); // Assignment. PThreadConditionLocker& operator=(const PThreadConditionLocker& rhs); public: // methods. // Constructor from reference. explicit PThreadConditionLocker(PThreadCondition& mtx); // Constructor from pointer. explicit PThreadConditionLocker(PThreadCondition* pmtx); // Destructor. ~PThreadConditionLocker(); }; #endif