Mutual exclusion lock used for synchronization.
More...
#include <GMutex.h>
Mutual exclusion lock used for synchronization.
- See also
- G3D::GThread, G3D::AtomicInt32, G3D::Spinlock
217 ::InitializeCriticalSection(&
m_handle);
219 int ret = pthread_mutexattr_init(&
m_attr);
221 ret = pthread_mutexattr_settype(&
m_attr, PTHREAD_MUTEX_RECURSIVE);
#define debugAssert(exp)
Definition: debugAssert.h:160
pthread_mutexattr_t m_attr
Definition: GMutex.h:82
pthread_mutex_t m_handle
Definition: GMutex.h:81
233 int ret = pthread_mutex_destroy(&
m_handle);
235 ret = pthread_mutexattr_destroy(&
m_attr);
#define debugAssert(exp)
Definition: debugAssert.h:160
pthread_mutexattr_t m_attr
Definition: GMutex.h:82
pthread_mutex_t m_handle
Definition: GMutex.h:81
void G3D::GMutex::lock |
( |
| ) |
|
Locks the mutex or blocks until available.
pthread_mutex_t m_handle
Definition: GMutex.h:81
bool G3D::GMutex::tryLock |
( |
| ) |
|
Locks the mutex if it not already locked. Returns true if lock successful, false otherwise.
242 return (::TryEnterCriticalSection(&
m_handle) != 0);
244 return (pthread_mutex_trylock(&
m_handle) == 0);
pthread_mutex_t m_handle
Definition: GMutex.h:81
void G3D::GMutex::unlock |
( |
| ) |
|
Unlocks the mutex.
pthread_mutex_t m_handle
Definition: GMutex.h:81
pthread_mutexattr_t G3D::GMutex::m_attr |
|
private |
pthread_mutex_t G3D::GMutex::m_handle |
|
private |
The documentation for this class was generated from the following files: