18 INLINE
void MutexDebug::
20 TAU_PROFILE(
"void MutexDebug::acquire()",
" ", TAU_USER);
22 ((MutexDebug *)
this)->do_lock(Thread::get_current_thread());
23 _global_lock->unlock();
30 INLINE
bool MutexDebug::
32 TAU_PROFILE(
"void MutexDebug::try_lock()",
" ", TAU_USER);
34 bool acquired = ((MutexDebug *)
this)->do_try_lock(Thread::get_current_thread());
35 _global_lock->unlock();
43 INLINE
void MutexDebug::
45 TAU_PROFILE(
"void MutexDebug::unlock()",
" ", TAU_USER);
47 ((MutexDebug *)
this)->do_unlock();
48 _global_lock->unlock();
61 INLINE
void MutexDebug::
62 acquire(
Thread *current_thread)
const {
63 TAU_PROFILE(
"void MutexDebug::acquire(Thread *)",
" ", TAU_USER);
64 nassertv(current_thread == Thread::get_current_thread());
66 ((MutexDebug *)
this)->do_lock(current_thread);
67 _global_lock->unlock();
74 INLINE
bool MutexDebug::
75 try_acquire(
Thread *current_thread)
const {
76 TAU_PROFILE(
"void MutexDebug::try_acquire(Thread *)",
" ", TAU_USER);
77 nassertr(current_thread == Thread::get_current_thread(),
false);
79 bool acquired = ((MutexDebug *)
this)->do_try_lock(current_thread);
80 _global_lock->unlock();
94 INLINE
void MutexDebug::
95 elevate_lock()
const {
96 TAU_PROFILE(
"void MutexDebug::elevate_lock()",
" ", TAU_USER);
99 nassertv(_allow_recursion);
102 nassertv(debug_is_locked());
114 INLINE
void MutexDebug::
116 TAU_PROFILE(
"void MutexDebug::release()",
" ", TAU_USER);
117 _global_lock->lock();
118 ((MutexDebug *)
this)->do_unlock();
119 _global_lock->unlock();
128 INLINE
bool MutexDebug::
129 debug_is_locked()
const {
130 TAU_PROFILE(
"bool MutexDebug::debug_is_locked()",
" ", TAU_USER);
131 _global_lock->lock();
132 bool is_locked = do_debug_is_locked();
133 _global_lock->unlock();
145 if (_global_lock ==
nullptr) {
A thread; that is, a lightweight process.
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...