Condition Variable

API for platform independent mutex synchronization primitive.

dmConditionVariable::HConditionVariable

HConditionVariable type definition

typedef struct ConditionVariable* HConditionVariable;


dmConditionVariable::New()

create condition variable

Create a new HConditionVariable

RETURN

condition_variable - A new ConditionVariable handle.


dmConditionVariable::Delete(mutex)

delete condition variable

Deletes a HConditionVariable.

PARAMETERS

mutex - ConditionVariable handle to delete.


dmConditionVariable::Wait(condition, mutex)

wait for condition variable

Wait for condition variable. This is a blocking function, and should be called with the mutex being locked.

PARAMETERS

condition - ConditionVariable handle.

mutex - Mutex handle.


dmConditionVariable::Signal(condition)

signal condition variable

Signal condition variable, effectively unblocks at least one of the waiting threads blocked by the condition variable.

PARAMETERS

condition - ConditionVariable handle.


dmConditionVariable::Broadcast(condition)

broadcast condition variable

Broadcast condition variable, effectively unblocks all of the waiting threads blocked by the condition variable.

PARAMETERS

condition - ConditionVariable handle.