12345678910111213141516171819202122232425 |
- #ifndef CSINGLELOCK_H
- #define CSINGLELOCK_H
- #include <pthread.h>
- class CSingleLock
- {
- public:
- CSingleLock();
- CSingleLock(pthread_mutex_t * pObject, bool bInitialLock = false);
- // Operations
- public:
- bool Lock();
- bool Unlock();
- bool IsLocked();
- public:
- ~CSingleLock();
- protected:
- pthread_mutex_t* m_pObject;
- bool m_bAcquired;
- };
- #endif // CSINGLELOCK_H
|