2PL_ALWAYS_INLINE plMutex::plMutex()
4 pthread_mutexattr_t mutexAttributes;
5 pthread_mutexattr_init(&mutexAttributes);
6 pthread_mutexattr_settype(&mutexAttributes, PTHREAD_MUTEX_RECURSIVE);
8 pthread_mutex_init(&m_hHandle, &mutexAttributes);
10 pthread_mutexattr_destroy(&mutexAttributes);
13PL_ALWAYS_INLINE plMutex::~plMutex()
15 pthread_mutex_destroy(&m_hHandle);
20 pthread_mutex_lock(&m_hHandle);
26 if (pthread_mutex_trylock(&m_hHandle) == 0)
37 pthread_mutex_unlock(&m_hHandle);
void Unlock()
Releases a lock that has been previously acquired.
Definition Mutex_posix.h:34
plResult TryLock()
Attempts to acquire an exclusive lock for this mutex object. Returns true on success.
Definition Mutex_posix.h:24
void Lock()
Acquires an exclusive lock for this mutex object.
Definition Mutex_posix.h:18
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54