Skip to content

create_eventCreateEventCreateEventcreate_eventT_create_event🔗

Short description🔗

create_eventCreateEventCreateEventcreate_eventT_create_event — Create an event synchronization object.

Signature🔗

create_event( attribute.name AttribName, attribute.value AttribValue, out event EventHandle )void CreateEvent( const HTuple& AttribName, const HTuple& AttribValue, HTuple* EventHandle )static void HOperatorSet.CreateEvent( HTuple attribName, HTuple attribValue, out HTuple eventHandle )def create_event( attrib_name: MaybeSequence[Union[int, float, str]], attrib_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_event( const Htuple AttribName, const Htuple AttribValue, Htuple* EventHandle )

void HEvent::HEvent( const HTuple& AttribName, const HTuple& AttribValue )

void HEvent::HEvent( const HString& AttribName, const HString& AttribValue )

void HEvent::HEvent( const char* AttribName, const char* AttribValue )

void HEvent::HEvent( const wchar_t* AttribName, const wchar_t* AttribValue ) (Windows only)

public HEvent( HTuple attribName, HTuple attribValue )

public HEvent( string attribName, string attribValue )

void HEvent::CreateEvent( const HTuple& AttribName, const HTuple& AttribValue )

void HEvent::CreateEvent( const HString& AttribName, const HString& AttribValue )

void HEvent::CreateEvent( const char* AttribName, const char* AttribValue )

void HEvent::CreateEvent( const wchar_t* AttribName, const wchar_t* AttribValue ) (Windows only)

void HEvent.CreateEvent( HTuple attribName, HTuple attribValue )

void HEvent.CreateEvent( string attribName, string attribValue )

Description🔗

An event is a prelocked mutual exclusion that does not belong to a thread, i.e., it can be signaled by a thread different from the locking thread. This understanding is, e.g., close to the definition of an event in WIN32-API or a semaphore with count 0 in POSIX threads.

create_eventCreateEvent allocates and initializes the event object according to the attributes specified in AttribNameattribNameattrib_name and AttribValueattribValueattrib_value. AttribNameattribNameattrib_name specifies the attribute class and AttribValueattribValueattrib_value the kind of the event. The description beneath lists all mutex kinds supported by following classes:

  • ''"" empty string sets the default attributes.

  • 'type'"type" specifies what happens if a thread waits on a signal to an event:

    • 'sleep'"sleep" simply suspends the calling thread (default).

    • 'spin'"spin" a fast event implementation that waits busy on a signal. This type is non recursive.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

AttribNameattribNameattrib_name (input_control) attribute.name(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Mutex attribute.

Default: [][]
List of values: 'type'"type"

AttribValueattribValueattrib_value (input_control) attribute.value(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Mutex attribute value.

Number of elements: AttribValue == AttribName
Default: [][]
List of values: 'sleep', 'spin'"sleep", "spin"

EventHandleeventHandleevent_handle (output_control) event → (handle)HTuple (HHandle)HEvent, HTuple (IntPtr)HHandleHtuple (handle)

Event synchronization object.

Result🔗

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

Combinations with other operators🔗

Combinations

Possible successors

wait_eventWaitEvent, signal_eventSignalEvent, clear_eventClearEvent

See also

clear_eventClearEvent

Module🔗

Foundation