wait_conditionT_wait_conditionWaitConditionWaitConditionwait_condition (Operator)
Name
wait_conditionT_wait_conditionWaitConditionWaitConditionwait_condition
— wait on the signal of a condition synchronization object.
Signature
Description
wait_conditionwait_conditionWaitConditionWaitConditionWaitConditionwait_condition
atomically unlocks the MutexHandleMutexHandleMutexHandleMutexHandlemutexHandlemutex_handle
(as per
unlock_mutexunlock_mutexUnlockMutexUnlockMutexUnlockMutexunlock_mutex
) and waits for the condition variable
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandlecondition_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_conditionWaitConditionWaitConditionWaitConditionwait_condition
. Before returning to the calling thread,
wait_conditionwait_conditionWaitConditionWaitConditionWaitConditionwait_condition
re-acquires MutexHandleMutexHandleMutexHandleMutexHandlemutexHandlemutex_handle
(as per lock_mutexlock_mutexLockMutexLockMutexLockMutexlock_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
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandlecondition_handle
(input_control) condition →
HCondition, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Condition synchronization object.
MutexHandleMutexHandleMutexHandleMutexHandlemutexHandlemutex_handle
(input_control) mutex →
HMutex, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Mutex synchronization object.
Result
wait_conditionwait_conditionWaitConditionWaitConditionWaitConditionwait_condition
returns TRUE if all parameters are correct.
If necessary, an exception is raised.
Possible Successors
signal_conditionsignal_conditionSignalConditionSignalConditionSignalConditionsignal_condition
,
clear_conditionclear_conditionClearConditionClearConditionClearConditionclear_condition
Module
Foundation