- Select ref document -

SDK Mutex API documentation

version 1.2.157

<dmsdk/dlib/mutex.h>

API for platform independent mutex synchronization primitive.

Functions

dmMutex::Delete

dmMutex::Delete(mutex)

Deletes a HMutex.

Parameters

mutex

dmMutex::HMutex Mutex handle to delete.

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.

mutex

dmMutex::HMutex Mutex handle to lock.

dmMutex::New

dmMutex::New()

Creates a new HMutex.

Returns

mutex

dmMutex::HMutex A new Mutex handle.

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.

mutex

dmMutex::HMutex Mutex handle to lock.

Returns

result

bool True if mutex was successfully locked, false otherwise.

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.

mutex

dmMutex::HMutex Mutex handle to unlock.

Macros

DM_MUTEX_SCOPED_LOCK

DM_MUTEX_SCOPED_LOCK(mutex)

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

Parameters

mutex

dmMutex::HMutex Mutex handle to lock.

mutex

dmMutex::HMutex Mutex handle to lock.

Typedefs

dmMutex::HMutex

typedef struct Mutex* HMutex;