create_conditionT_create_conditionCreateConditionCreateCondition (Operator)
Name
create_conditionT_create_conditionCreateConditionCreateCondition
— Create a condition variable synchronization object.
Signature
void CreateCondition(const HTuple& AttribName, const HTuple& AttribValue, HTuple* ConditionHandle)
void HCondition::HCondition(const HTuple& AttribName, const HTuple& AttribValue)
void HCondition::HCondition(const HString& AttribName, const HString& AttribValue)
void HCondition::HCondition(const char* AttribName, const char* AttribValue)
void HCondition::HCondition(const wchar_t* AttribName, const wchar_t* AttribValue)
(Windows only)
void HCondition::CreateCondition(const HTuple& AttribName, const HTuple& AttribValue)
void HCondition::CreateCondition(const HString& AttribName, const HString& AttribValue)
void HCondition::CreateCondition(const char* AttribName, const char* AttribValue)
void HCondition::CreateCondition(const wchar_t* AttribName, const wchar_t* AttribValue)
(Windows only)
Description
A condition variable (short: “condition”) is a synchronization
device that allows threads to suspend execution and relinquish the
processors until some predicate on shared data is satisfied. The basic
operations on conditions are: signal the condition (when the predicate
becomes true), and wait for the condition, suspending the thread execution
until another thread signals the condition.
A condition variable must always be associated with a mutex, to avoid
the race condition where a thread prepares to wait on a condition variable
and another thread signals the condition just before the first
thread actually waits on it.
create_conditioncreate_conditionCreateConditionCreateConditionCreateCondition
creates and initializes the condition variable
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandle
, using the condition attributes specified in
AttribNameAttribNameAttribNameAttribNameattribName
and AttribValueAttribValueAttribValueAttribValueattribValue
, or default attributes if
AttribNameAttribNameAttribNameAttribNameattribName
is ''"""""""".
The current implementation supports no
attributes for conditions, hence the AttribNameAttribNameAttribNameAttribNameattribName
parameter must
be set to ''"""""""".
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
AttribNameAttribNameAttribNameAttribNameattribName
(input_control) number(-array) →
HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Mutex attribute.
Default value: []
AttribValueAttribValueAttribValueAttribValueattribValue
(input_control) number(-array) →
HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Mutex attribute value.
Number of elements: AttribValue == AttribName
Default value: []
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandle
(output_control) condition →
HCondition, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Condition synchronization object.
Result
create_conditioncreate_conditionCreateConditionCreateConditionCreateCondition
returns 2 (H_MSG_TRUE) if all parameters are correct.
If necessary, an exception is raised.
Possible Successors
wait_conditionwait_conditionWaitConditionWaitConditionWaitCondition
,
timed_wait_conditiontimed_wait_conditionTimedWaitConditionTimedWaitConditionTimedWaitCondition
,
signal_conditionsignal_conditionSignalConditionSignalConditionSignalCondition
See also
clear_conditionclear_conditionClearConditionClearConditionClearCondition
Module
Foundation