Panda3D
|
00001 // Filename: lightReMutexHolder.h 00002 // Created by: drose (08Oct08) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef LIGHTREMUTEXHOLDER_H 00016 #define LIGHTREMUTEXHOLDER_H 00017 00018 #include "pandabase.h" 00019 #include "lightReMutex.h" 00020 00021 class Thread; 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : LightReMutexHolder 00025 // Description : Similar to MutexHolder, but for a light reentrant mutex. 00026 //////////////////////////////////////////////////////////////////// 00027 class EXPCL_PANDA_PIPELINE LightReMutexHolder { 00028 public: 00029 INLINE LightReMutexHolder(const LightReMutex &mutex); 00030 INLINE LightReMutexHolder(const LightReMutex &mutex, Thread *current_thread); 00031 INLINE LightReMutexHolder(LightReMutex *&mutex); 00032 INLINE ~LightReMutexHolder(); 00033 private: 00034 INLINE LightReMutexHolder(const LightReMutexHolder ©); 00035 INLINE void operator = (const LightReMutexHolder ©); 00036 00037 private: 00038 #if defined(HAVE_THREADS) || defined(DEBUG_THREADS) 00039 const LightReMutex *_mutex; 00040 #endif 00041 }; 00042 00043 #include "lightReMutexHolder.I" 00044 00045 #endif