create_conditionT_create_conditionCreateConditionCreateConditioncreate_condition (Operator)
Name
create_conditionT_create_conditionCreateConditionCreateConditioncreate_condition
— 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)
def create_condition(attrib_name: MaybeSequence[Union[int, float, str]], attrib_value: MaybeSequence[Union[int, float, str]]) -> HHandle
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_conditionCreateConditionCreateConditionCreateConditioncreate_condition
creates and initializes the condition variable
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandlecondition_handle
, using the condition attributes specified in
AttribNameAttribNameAttribNameAttribNameattribNameattrib_name
and AttribValueAttribValueAttribValueAttribValueattribValueattrib_value
, or default attributes if
AttribNameAttribNameAttribNameAttribNameattribNameattrib_name
is ''"""""""""".
The current implementation supports no
attributes for conditions, hence the AttribNameAttribNameAttribNameAttribNameattribNameattrib_name
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
AttribNameAttribNameAttribNameAttribNameattribNameattrib_name
(input_control) number(-array) →
HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Mutex attribute.
Default value: []
AttribValueAttribValueAttribValueAttribValueattribValueattrib_value
(input_control) number(-array) →
HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Mutex attribute value.
Number of elements: AttribValue == AttribName
Default value: []
ConditionHandleConditionHandleConditionHandleConditionHandleconditionHandlecondition_handle
(output_control) condition →
HCondition, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Condition synchronization object.
Result
create_conditioncreate_conditionCreateConditionCreateConditionCreateConditioncreate_condition
returns 2 (H_MSG_TRUE) if all parameters are correct.
If necessary, an exception is raised.
Possible Successors
wait_conditionwait_conditionWaitConditionWaitConditionWaitConditionwait_condition
,
timed_wait_conditiontimed_wait_conditionTimedWaitConditionTimedWaitConditionTimedWaitConditiontimed_wait_condition
,
signal_conditionsignal_conditionSignalConditionSignalConditionSignalConditionsignal_condition
See also
clear_conditionclear_conditionClearConditionClearConditionClearConditionclear_condition
Module
Foundation