2001-10-06 14:13:28 +00:00
|
|
|
#ifndef CMUTEX_H
|
|
|
|
#define CMUTEX_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
// recursive mutex class
|
|
|
|
class CMutex {
|
|
|
|
public:
|
|
|
|
// 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
|
|
|
|
|
|
|
|
// this has no effect. it's only here to allow assignment of
|
|
|
|
// objects that have mutexes.
|
|
|
|
CMutex& operator=(const CMutex&);
|
|
|
|
|
|
|
|
// accessors
|
|
|
|
|
2001-10-14 16:58:01 +00:00
|
|
|
void lock() const;
|
|
|
|
void unlock() const;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void init();
|
|
|
|
void fini();
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class CCondVarBase;
|
|
|
|
void* m_mutex;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|