33 #include "../api_core.h"
90 CRITICAL_SECTION critical_section;
92 pthread_mutex_t handle;
106 : mutex(mutex), lock_count(0)
114 if (lock_count > 0 && mutex)
148 if (mutex == 0 || mutex->try_lock())
int get_lock_count() const
Returns the amounts of recursive mutex locks performed by this section.
Definition: mutex.h:126
~MutexSection()
Definition: mutex.h:112
void lock()
Lock the mutex.
Definition: mutex.h:138
bool try_lock()
Attempt to lock mutex.
Definition: mutex.h:146
void unlock()
Unlock mutex.
Definition: mutex.h:157
MutexSection(Mutex *mutex, bool lock_mutex=true)
Constructs a mutex section.
Definition: mutex.h:105
Mutex locking helper.
Definition: mutex.h:98
Mutex class.
Definition: mutex.h:50