00001 // Filename: conditionVarFull.I 00002 // Created by: drose (28Aug06) 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: ConditionVarFull::Constructor 00018 // Access: Published 00019 // Description: You must pass in a Mutex to the condition variable 00020 // constructor. This mutex may be shared by other 00021 // condition variables, if desired. It is the caller's 00022 // responsibility to ensure the Mutex object does not 00023 // destruct during the lifetime of the condition 00024 // variable. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE ConditionVarFull:: 00027 ConditionVarFull(Mutex &mutex) : 00028 #ifdef DEBUG_THREADS 00029 ConditionVarFullDebug(mutex) 00030 #else 00031 ConditionVarFullDirect(mutex) 00032 #endif // DEBUG_THREADS 00033 { 00034 } 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Function: ConditionVarFull::Destructor 00038 // Access: Published 00039 // Description: 00040 //////////////////////////////////////////////////////////////////// 00041 INLINE ConditionVarFull:: 00042 ~ConditionVarFull() { 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: ConditionVarFull::Copy Constructor 00047 // Access: Private 00048 // Description: Do not attempt to copy condition variables. 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE ConditionVarFull:: 00051 ConditionVarFull(const ConditionVarFull ©) : 00052 #ifdef DEBUG_THREADS 00053 ConditionVarFullDebug(copy.get_mutex()) 00054 #else 00055 ConditionVarFullDirect(copy.get_mutex()) 00056 #endif // DEBUG_THREADS 00057 { 00058 nassertv(false); 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: ConditionVarFull::Copy Assignment Operator 00063 // Access: Private 00064 // Description: Do not attempt to copy condition variables. 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void ConditionVarFull:: 00067 operator = (const ConditionVarFull ©) { 00068 nassertv(false); 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: ConditionVarFull::get_mutex 00073 // Access: Published 00074 // Description: Returns the mutex associated with this condition 00075 // variable. 00076 //////////////////////////////////////////////////////////////////// 00077 INLINE Mutex &ConditionVarFull:: 00078 get_mutex() const { 00079 #ifdef DEBUG_THREADS 00080 return (Mutex &)ConditionVarFullDebug::get_mutex(); 00081 #else 00082 return (Mutex &)ConditionVarFullDirect::get_mutex(); 00083 #endif // DEBUG_THREADS 00084 }