Panda3D

reMutexHolder.h

00001 // Filename: reMutexHolder.h
00002 // Created by:  drose (15Jan06)
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 REMUTEXHOLDER_H
00016 #define REMUTEXHOLDER_H
00017 
00018 #include "pandabase.h"
00019 #include "reMutex.h"
00020 
00021 class Thread;
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : ReMutexHolder
00025 // Description : Similar to MutexHolder, but for a reentrant mutex.
00026 ////////////////////////////////////////////////////////////////////
00027 class EXPCL_PANDA_PIPELINE ReMutexHolder {
00028 public:
00029   INLINE ReMutexHolder(const ReMutex &mutex);
00030   INLINE ReMutexHolder(const ReMutex &mutex, Thread *current_thread);
00031   INLINE ReMutexHolder(ReMutex *&mutex);
00032   INLINE ~ReMutexHolder();
00033 private:
00034   INLINE ReMutexHolder(const ReMutexHolder &copy);
00035   INLINE void operator = (const ReMutexHolder &copy);
00036 
00037 private:
00038 #if defined(HAVE_THREADS) || defined(DEBUG_THREADS)
00039   const ReMutex *_mutex;
00040 #endif
00041 };
00042 
00043 #include "reMutexHolder.I"
00044 
00045 #endif
 All Classes Functions Variables Enumerations