create_eventT_create_eventCreateEventCreateEventcreate_event (Operator)

Name

create_eventT_create_eventCreateEventCreateEventcreate_event — Erzeugen eines Event-Synchronisationsobjektes.

Signatur

create_event( : : AttribName, AttribValue : EventHandle)

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

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)   ( Nur Windows)

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)   ( Nur Windows)

static void HOperatorSet.CreateEvent(HTuple attribName, HTuple attribValue, out HTuple eventHandle)

public HEvent(HTuple attribName, HTuple attribValue)

public HEvent(string attribName, string attribValue)

void HEvent.CreateEvent(HTuple attribName, HTuple attribValue)

void HEvent.CreateEvent(string attribName, string attribValue)

def create_event(attrib_name: MaybeSequence[Union[int, float, str]], attrib_value: MaybeSequence[Union[int, float, str]]) -> HHandle

Beschreibung

Ein Event ist ein Mutex, der keinem Thread gehört. D.h., er kann von einem anderen Thread freigegeben werden als von dem, der ihn gesperrt hat. Daher werden Events meist dann eingesetzt, wenn ein Thread einem anderem, wartenden Thread signalisieren soll, dass dieser weiterlaufen kann. Dieses Verständnis von Events leitet sich aus der Definition eines Events der WIN32-API oder der einer Semaphore (mit Zähler 0) der POSIX-Thread-Spezifikation ab.

create_eventcreate_eventCreateEventCreateEventcreate_event legt ein Eventobjekt an und initialisiert es entsprechend der Attribute, die über die Parameter AttribNameAttribNameAttribNameattribNameattrib_name und AttribValueAttribValueAttribValueattribValueattrib_value gesetzt werden. AttribNameAttribNameAttribNameattribNameattrib_name definiert die Klasse und AttribValueAttribValueAttribValueattribValueattrib_value den Typ des Events. Im Folgenden werden die möglichen Attributwerte für die gelisteten Attributnamen beschrieben:

''""""""""

der leere String setzt die Standardattribute.

'type'"type""type""type""type"

spezifiziert das Verhalten eines Events, wenn ein Thread auf ein Signal warten muss:

'sleep'"sleep""sleep""sleep""sleep"

unterbricht den aufrufenden Thread und legt ihn schlafen (Standard).

'spin'"spin""spin""spin""spin"

ist die schnelle Implementierung eines Events, die in einer Schleife auf die Signalisierung des Events wartet. Dieser Typ ist nicht rekursiv.

Nach der Initialisierung ist ein Event gesperrt.

Ausführungsinformationen

Parameter

AttribNameAttribNameAttribNameattribNameattrib_name (input_control)  attribute.name(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Event-Attribut.

Default: []

Werteliste: 'type'"type""type""type""type"

AttribValueAttribValueAttribValueattribValueattrib_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Event-Attributwert.

Parameteranzahl: AttribValue == AttribName

Default: []

Werteliste: 'sleep'"sleep""sleep""sleep""sleep", 'spin'"spin""spin""spin""spin"

EventHandleEventHandleEventHandleeventHandleevent_handle (output_control)  event HEvent, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Event-Synchronisationsobjekt.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert create_eventcreate_eventCreateEventCreateEventcreate_event den Wert 2 ( H_MSG_TRUE) . Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

wait_eventwait_eventWaitEventWaitEventwait_event, signal_eventsignal_eventSignalEventSignalEventsignal_event, clear_eventclear_eventClearEventClearEventclear_event

Siehe auch

clear_eventclear_eventClearEventClearEventclear_event

Modul

Foundation