barrier/mt/CMutex.h

36 lines
587 B
C
Raw Normal View History

2001-10-06 14:13:28 +00:00
#ifndef CMUTEX_H
#define CMUTEX_H
#include "common.h"
// recursive mutex class
class CMutex {
2002-04-29 14:40:01 +00:00
public:
2001-10-06 14:13:28 +00:00
// copy c'tor is equivalent to default c'tor. it's here to
// allow copying of objects that have mutexes.
CMutex();
CMutex(const CMutex&);
~CMutex();
// manipulators
2002-04-29 14:40:01 +00:00
// this has no effect. it's only here to allow assignment of
2001-10-06 14:13:28 +00:00
// objects that have mutexes.
2002-04-29 14:40:01 +00:00
CMutex& operator=(const CMutex&);
2001-10-06 14:13:28 +00:00
// accessors
void lock() const;
void unlock() const;
2001-10-06 14:13:28 +00:00
2002-04-29 14:40:01 +00:00
private:
2001-10-06 14:13:28 +00:00
void init();
void fini();
2002-04-29 14:40:01 +00:00
private:
2001-10-06 14:13:28 +00:00
friend class CCondVarBase;
2002-04-29 14:40:01 +00:00
void* m_mutex;
2001-10-06 14:13:28 +00:00
};
#endif