// PThreadMutexLocker.h #ifndef dset__PThreadMutexLocker_H #define dset__PThreadMutexLocker_H // Class that locks a PThreadMutex upon construction and then unlocks // is during destruction. #include "dataset_util/PThreadMutex.h" class PThreadMutexLocker { private: // data PThreadMutex* m_pmtx; private: // Hide copy and assignment. // Copy. PThreadMutexLocker(const PThreadMutexLocker& rhs); // Assignment. PThreadMutexLocker& operator=(const PThreadMutexLocker& rhs); public: // methods. // Constructor from reference. explicit PThreadMutexLocker(PThreadMutex& mtx); // Constructor from pointer. explicit PThreadMutexLocker(PThreadMutex* pmtx); // Destructor. ~PThreadMutexLocker(); }; #endif