Panda3D
 All Classes Functions Variables Enumerations
lightReMutexHolder.h
1 // Filename: lightReMutexHolder.h
2 // Created by: drose (08Oct08)
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 LIGHTREMUTEXHOLDER_H
16 #define LIGHTREMUTEXHOLDER_H
17 
18 #include "pandabase.h"
19 #include "lightReMutex.h"
20 
21 class Thread;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : LightReMutexHolder
25 // Description : Similar to MutexHolder, but for a light reentrant mutex.
26 ////////////////////////////////////////////////////////////////////
27 class EXPCL_PANDA_PIPELINE LightReMutexHolder {
28 public:
29  INLINE LightReMutexHolder(const LightReMutex &mutex);
30  INLINE LightReMutexHolder(const LightReMutex &mutex, Thread *current_thread);
31  INLINE LightReMutexHolder(LightReMutex *&mutex);
32  INLINE ~LightReMutexHolder();
33 private:
34  INLINE LightReMutexHolder(const LightReMutexHolder &copy);
35  INLINE void operator = (const LightReMutexHolder &copy);
36 
37 private:
38 #if defined(HAVE_THREADS) || defined(DEBUG_THREADS)
39  const LightReMutex *_mutex;
40 #endif
41 };
42 
43 #include "lightReMutexHolder.I"
44 
45 #endif
A lightweight reentrant mutex.
Definition: lightReMutex.h:34
Similar to MutexHolder, but for a light reentrant mutex.
A thread; that is, a lightweight process.
Definition: thread.h:51