create_eventT_create_eventCreateEventCreateEvent (Operator)
Name
create_eventT_create_eventCreateEventCreateEvent
— Create an event synchronization object.
Signature
void CreateEvent(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)
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)
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_eventcreate_eventCreateEventCreateEventCreateEvent
allocates and initializes the event object according
to the attributes specified in AttribNameAttribNameAttribNameAttribNameattribName
and AttribValueAttribValueAttribValueAttribValueattribValue
.
AttribNameAttribNameAttribNameAttribNameattribName
specifies the attribute class and AttribValueAttribValueAttribValueAttribValueattribValue
the kind of the event. The description beneath lists all mutex kinds
supported by following classes:
- ''""""""""
empty string sets the default attributes.
- 'type'"type""type""type""type"
-
specifies what happens if a thread waits on a signal to
an event:
- 'sleep'"sleep""sleep""sleep""sleep"
simply suspends the calling thread (default).
- 'spin'"spin""spin""spin""spin"
a fast event implementation that waits busy
on a signal. This type is non recursive.
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) attribute.name(-array) →
HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Mutex attribute.
Default value: []
List of values: 'type'"type""type""type""type"
AttribValueAttribValueAttribValueAttribValueattribValue
(input_control) attribute.value(-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: []
List of values: 'sleep'"sleep""sleep""sleep""sleep", 'spin'"spin""spin""spin""spin"
EventHandleEventHandleEventHandleEventHandleeventHandle
(output_control) event →
HEvent, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Event synchronization object.
Result
create_eventcreate_eventCreateEventCreateEventCreateEvent
returns 2 (H_MSG_TRUE) if all parameters are correct.
If necessary, an exception is raised.
Possible Successors
wait_eventwait_eventWaitEventWaitEventWaitEvent
,
signal_eventsignal_eventSignalEventSignalEventSignalEvent
,
clear_eventclear_eventClearEventClearEventClearEvent
See also
clear_eventclear_eventClearEventClearEventClearEvent
Module
Foundation