SDK Mutex API documentation

<dmsdk/dlib/mutex.h>

API for platform independent mutex synchronization primitive.

FUNCTION
dmMutex::Delete()

delete Mutex.

dmMutex::Lock()

lock Mutex.

dmMutex::New()

create Mutex

dmMutex::TryLock()

non-blocking lock of Mutex.

dmMutex::Unlock()

unlock Mutex.

Functions

dmMutex::Delete()

dmMutex::Delete(mutex)

Deletes a HMutex.

PARAMETERS

mutex

dmMutex::HMutex Mutex handle to delete.


dmMutex::Lock()

dmMutex::Lock(mutex)

Lock a HMutex, will block until mutex is unlocked if already locked elsewhere.

PARAMETERS

mutex

dmMutex::HMutex Mutex handle to lock.


dmMutex::New()

dmMutex::New()

Creates a new HMutex.

PARAMETERS

RETURNS

mutex

dmMutex::HMutex A new Mutex handle.


dmMutex::TryLock()

dmMutex::TryLock(mutex)

Tries to lock a HMutex, if mutex is already locked it will return false and continue without locking the mutex.

PARAMETERS

mutex

dmMutex::HMutex Mutex handle to lock.

RETURNS

result

bool True if mutex was successfully locked, false otherwise.


dmMutex::Unlock()

dmMutex::Unlock(mutex)

Unlock a HMutex.

PARAMETERS

mutex

dmMutex::HMutex Mutex handle to unlock.


Macros

DM_MUTEX_SCOPED_LOCK

macro for scope lifetime Mutex locking

Will lock a Mutex and automatically unlock it at the end of the scope.

mutex

dmMutex::HMutex Mutex handle to lock.