Panda3D
reMutex.h
1 // Filename: reMutex.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 REMUTEX_H
16 #define REMUTEX_H
17 
18 #include "pandabase.h"
19 #include "mutexDebug.h"
20 #include "reMutexDirect.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : ReMutex
24 // Description : A reentrant mutex. This kind of mutex can be locked
25 // more than once by the thread that already holds it,
26 // without deadlock. The thread must eventually release
27 // the mutex the same number of times it locked it.
28 //
29 // This class inherits its implementation either from
30 // MutexDebug or ReMutexDirect, depending on the
31 // definition of DEBUG_THREADS.
32 ////////////////////////////////////////////////////////////////////
33 #ifdef DEBUG_THREADS
34 class EXPCL_PANDA_PIPELINE ReMutex : public MutexDebug
35 #else
36 class EXPCL_PANDA_PIPELINE ReMutex : public ReMutexDirect
37 #endif // DEBUG_THREADS
38 {
39 PUBLISHED:
40  INLINE ReMutex();
41 public:
42  INLINE ReMutex(const char *name);
43 PUBLISHED:
44  INLINE ReMutex(const string &name);
45  INLINE ~ReMutex();
46 private:
47  INLINE ReMutex(const ReMutex &copy);
48  INLINE void operator = (const ReMutex &copy);
49 };
50 
51 #include "reMutex.I"
52 
53 #endif
This class implements a standard reMutex by making direct calls to the underlying implementation laye...
Definition: reMutexDirect.h:32
A reentrant mutex.
Definition: reMutex.h:36