23 #ifndef __MULTITHREAD_MUTEX_H_ 24 #define __MULTITHREAD_MUTEX_H_ 58 inline void Lock() { pthread_mutex_lock(&
mID); }
63 inline void Unlock() { pthread_mutex_unlock(&
mID); }
pthread_mutex_t mID
Definition: Mutex.h:77
bool AttemptLock()
If the lock is free, aquire it.
Definition: Mutex.h:52
A lightweight mutual exclusion lock.
Definition: Mutex.h:35
void Lock()
Aquire the lock, whenever it becomes available.
Definition: Mutex.h:58
pthread_mutex_t * GetID()
Get the mutex object.
Definition: Mutex.h:74
void Unlock()
Release the lock.
Definition: Mutex.h:63
void Sync()
Wait for the lock, then release it immediately.
Definition: Mutex.h:69