//////////////////////////////////////////////////////////////////////// // class CMutex // // $Log: mutex.h,v $ // Revision 1.1 1997/06/13 18:11:03 nettleto // Initial revision // // #ifndef MUTEX_H #define MUTEX_H #include #include class CCond; class CMutex { protected: pthread_mutex_t m; public: CMutex () { pthread_mutex_init (&m, NULL); }; ~CMutex () { pthread_mutex_destroy (&m); }; void Lock () { pthread_mutex_lock (&m); }; int TryLock () { return pthread_mutex_trylock (&m); }; void Unlock () { pthread_mutex_unlock (&m); }; friend class CCond; }; #endif // not MUTEX_H