wait_conditionT_wait_conditionWaitConditionWaitConditionwait_condition (Operator)

Name

wait_conditionT_wait_conditionWaitConditionWaitConditionwait_condition — wait on the signal of a condition synchronization object.

Signature

wait_condition( : : ConditionHandle, MutexHandle : )

Herror T_wait_condition(const Htuple ConditionHandle, const Htuple MutexHandle)

void WaitCondition(const HTuple& ConditionHandle, const HTuple& MutexHandle)

void HCondition::WaitCondition(const HMutex& MutexHandle) const

static void HOperatorSet.WaitCondition(HTuple conditionHandle, HTuple mutexHandle)

void HCondition.WaitCondition(HMutex mutexHandle)

def wait_condition(condition_handle: HHandle, mutex_handle: HHandle) -> None

Description

wait_conditionwait_conditionWaitConditionWaitConditionwait_condition atomically unlocks the MutexHandleMutexHandleMutexHandlemutexHandlemutex_handle (as per unlock_mutexunlock_mutexUnlockMutexUnlockMutexunlock_mutex) and waits for the condition variable ConditionHandleConditionHandleConditionHandleconditionHandlecondition_handle to be signaled. The thread execution is suspended and does not consume any CPU time until the condition variable is signaled. The mutex must be locked by the calling thread on entrance to wait_conditionwait_conditionWaitConditionWaitConditionwait_condition. Before returning to the calling thread, wait_conditionwait_conditionWaitConditionWaitConditionwait_condition re-acquires MutexHandleMutexHandleMutexHandlemutexHandlemutex_handle (as per lock_mutexlock_mutexLockMutexLockMutexlock_mutex).

Unlocking the mutex and suspending on the condition variable is done atomically. Thus, if all threads always acquire the mutex before signaling the condition, this guarantees that the condition cannot be signaled (and thus ignored) between the time a thread locks the mutex and the time it waits on the condition variable.

Execution Information

Parameters

ConditionHandleConditionHandleConditionHandleconditionHandlecondition_handle (input_control)  condition HCondition, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Condition synchronization object.

MutexHandleMutexHandleMutexHandlemutexHandlemutex_handle (input_control)  mutex HMutex, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Mutex synchronization object.

Result

wait_conditionwait_conditionWaitConditionWaitConditionwait_condition returns 2 ( H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Successors

signal_conditionsignal_conditionSignalConditionSignalConditionsignal_condition, clear_conditionclear_conditionClearConditionClearConditionclear_condition

Module

Foundation