Panda3D
 All Classes Functions Variables Enumerations
reMutexHolder.h
1 // Filename: reMutexHolder.h
2 // Created by: drose (15Jan06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef REMUTEXHOLDER_H
16 #define REMUTEXHOLDER_H
17 
18 #include "pandabase.h"
19 #include "reMutex.h"
20 
21 class Thread;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : ReMutexHolder
25 // Description : Similar to MutexHolder, but for a reentrant mutex.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_PIPELINE ReMutexHolder {
28 public:
29  INLINE ReMutexHolder(const ReMutex &mutex);
30  INLINE ReMutexHolder(const ReMutex &mutex, Thread *current_thread);
31  INLINE ReMutexHolder(ReMutex *&mutex);
32  INLINE ~ReMutexHolder();
33 private:
34  INLINE ReMutexHolder(const ReMutexHolder &copy);
35  INLINE void operator = (const ReMutexHolder &copy);
36 
37 private:
38 #if defined(HAVE_THREADS) || defined(DEBUG_THREADS)
39  const ReMutex *_mutex;
40 #endif
41 };
42 
43 #include "reMutexHolder.I"
44 
45 #endif
Similar to MutexHolder, but for a reentrant mutex.
Definition: reMutexHolder.h:27
A thread; that is, a lightweight process.
Definition: thread.h:51
A reentrant mutex.
Definition: reMutex.h:36