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