00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef LIGHTMUTEXDIRECT_H
00016 #define LIGHTMUTEXDIRECT_H
00017
00018 #include "pandabase.h"
00019 #include "mutexImpl.h"
00020
00021 class Thread;
00022
00023 #ifndef DEBUG_THREADS
00024
00025
00026
00027
00028
00029
00030
00031 class EXPCL_PANDA_PIPELINE LightMutexDirect {
00032 protected:
00033 INLINE LightMutexDirect();
00034 INLINE ~LightMutexDirect();
00035 private:
00036 INLINE LightMutexDirect(const LightMutexDirect ©);
00037 INLINE void operator = (const LightMutexDirect ©);
00038
00039 PUBLISHED:
00040 BLOCKING INLINE void acquire() const;
00041 INLINE void release() const;
00042 INLINE bool debug_is_locked() const;
00043
00044 INLINE void set_name(const string &name);
00045 INLINE void clear_name();
00046 INLINE bool has_name() const;
00047 INLINE string get_name() const;
00048
00049 void output(ostream &out) const;
00050
00051 private:
00052 #ifdef DO_PSTATS
00053
00054
00055
00056
00057
00058 MutexTrueImpl _impl;
00059 #else
00060 MutexImpl _impl;
00061 #endif // DO_PSTATS
00062 };
00063
00064 INLINE ostream &
00065 operator << (ostream &out, const LightMutexDirect &m) {
00066 m.output(out);
00067 return out;
00068 }
00069
00070 #include "lightMutexDirect.I"
00071
00072 #endif // !DEBUG_THREADS
00073
00074 #endif