home *** CD-ROM | disk | FTP | other *** search
- // =================================================================
- // Mutex.h
- // =================================================================
- // Harold Kasperink / John Dekker
- // Dr. Dobb's Journal 1997
- // =================================================================
- // Mutex class
- // =================================================================
- #ifndef _MUTEX_H_
- #define _MUTEX_H_
-
- // Fake thread library
- typedef int pthread_mutex_t;
-
- ////////////////////////////////////////////////////////////////////
- // CNutex
- ////////////////////////////////////////////////////////////////////
- class CMutex
- {
- public:
- CMutex();
- ~CMutex();
-
- void Lock();
- void Unlock();
- int TryLock();
-
- private:
- pthread_mutex_t m_Mutex;
- };
-
- #endif
-