22 MutexDebug(
const MutexDebug ©) : _cvar_impl(*get_global_lock()) {
31 INLINE
void MutexDebug::
32 operator = (
const MutexDebug ©) {
51 INLINE
void MutexDebug::
52 acquire(
Thread *current_thread)
const {
53 TAU_PROFILE(
"void MutexDebug::acquire(Thread *)",
" ", TAU_USER);
55 _global_lock->acquire();
56 ((MutexDebug *)
this)->do_acquire(current_thread);
57 _global_lock->release();
67 INLINE
bool MutexDebug::
68 try_acquire(
Thread *current_thread)
const {
69 TAU_PROFILE(
"void MutexDebug::acquire(Thread *)",
" ", TAU_USER);
71 _global_lock->acquire();
72 bool acquired = ((MutexDebug *)
this)->do_try_acquire(current_thread);
73 _global_lock->release();
92 INLINE
void MutexDebug::
93 elevate_lock()
const {
94 TAU_PROFILE(
"void MutexDebug::elevate_lock()",
" ", TAU_USER);
97 nassertv(_allow_recursion);
100 nassertv(debug_is_locked());
115 INLINE
void MutexDebug::
117 TAU_PROFILE(
"void MutexDebug::release()",
" ", TAU_USER);
118 _global_lock->acquire();
119 ((MutexDebug *)
this)->do_release();
120 _global_lock->release();
133 INLINE
bool MutexDebug::
134 debug_is_locked()
const {
135 TAU_PROFILE(
"bool MutexDebug::debug_is_locked()",
" ", TAU_USER);
136 _global_lock->acquire();
137 bool is_locked = do_debug_is_locked();
138 _global_lock->release();
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
A thread; that is, a lightweight process.
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...