forgot to check this in

This commit is contained in:
David Rose 2011-09-02 23:09:18 +00:00
parent 5bdb3e695f
commit f63bf2526a
2 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,25 @@ MutexHolder(const Mutex &mutex) {
#endif
}
////////////////////////////////////////////////////////////////////
// Function: MutexHolder::Constructor
// Access: Public
// Description: This variant on the constructor accepts the current
// thread as a parameter, if it is already known, as an
// optimization.
////////////////////////////////////////////////////////////////////
INLINE MutexHolder::
MutexHolder(const Mutex &mutex, Thread *current_thread) {
#if defined(HAVE_THREADS) || defined(DEBUG_THREADS)
_mutex = &mutex;
// Actually, the regular Mutex class doesn't need the current thread
// parameter at the moment. So not actually an optimization. But
// we keep this method because it causes a symmetry with
// ReMutexHolder.
_mutex->acquire(/*current_thread*/);
#endif
}
////////////////////////////////////////////////////////////////////
// Function: MutexHolder::Constructor
// Access: Public

View File

@ -29,6 +29,7 @@
class EXPCL_PANDA_PIPELINE MutexHolder {
public:
INLINE MutexHolder(const Mutex &mutex);
INLINE MutexHolder(const Mutex &mutex, Thread *current_thread);
INLINE MutexHolder(Mutex *&mutex);
INLINE ~MutexHolder();
private: