Panda3D
conditionVarFull.I
1 // Filename: conditionVarFull.I
2 // Created by: drose (28Aug06)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: ConditionVarFull::Constructor
18 // Access: Published
19 // Description: You must pass in a Mutex to the condition variable
20 // constructor. This mutex may be shared by other
21 // condition variables, if desired. It is the caller's
22 // responsibility to ensure the Mutex object does not
23 // destruct during the lifetime of the condition
24 // variable.
25 ////////////////////////////////////////////////////////////////////
26 INLINE ConditionVarFull::
28 #ifdef DEBUG_THREADS
29  ConditionVarFullDebug(mutex)
30 #else
32 #endif // DEBUG_THREADS
33 {
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: ConditionVarFull::Destructor
38 // Access: Published
39 // Description:
40 ////////////////////////////////////////////////////////////////////
41 INLINE ConditionVarFull::
42 ~ConditionVarFull() {
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: ConditionVarFull::Copy Constructor
47 // Access: Private
48 // Description: Do not attempt to copy condition variables.
49 ////////////////////////////////////////////////////////////////////
50 INLINE ConditionVarFull::
51 ConditionVarFull(const ConditionVarFull &copy) :
52 #ifdef DEBUG_THREADS
53  ConditionVarFullDebug(copy.get_mutex())
54 #else
56 #endif // DEBUG_THREADS
57 {
58  nassertv(false);
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: ConditionVarFull::Copy Assignment Operator
63 // Access: Private
64 // Description: Do not attempt to copy condition variables.
65 ////////////////////////////////////////////////////////////////////
66 INLINE void ConditionVarFull::
67 operator = (const ConditionVarFull &copy) {
68  nassertv(false);
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: ConditionVarFull::get_mutex
73 // Access: Published
74 // Description: Returns the mutex associated with this condition
75 // variable.
76 ////////////////////////////////////////////////////////////////////
78 get_mutex() const {
79 #ifdef DEBUG_THREADS
80  return (Mutex &)ConditionVarFullDebug::get_mutex();
81 #else
83 #endif // DEBUG_THREADS
84 }
A standard mutex, or mutual exclusion lock.
Definition: pmutex.h:44
Mutex & get_mutex() const
Returns the mutex associated with this condition variable.
ConditionVarFull(Mutex &mutex)
You must pass in a Mutex to the condition variable constructor.
MutexDirect & get_mutex() const
Returns the mutex associated with this condition variable.
A condition variable, usually used to communicate information about changing state to a thread that i...
This class implements a condition variable; see ConditionVar for a brief introduction to this class...
ConditionVarFullDirect(MutexDirect &mutex)
You must pass in a Mutex to the condition variable constructor.