create_eventT_create_eventCreateEventCreateEvent (Operator)

Name

create_eventT_create_eventCreateEventCreateEvent — 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)

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_eventCreateEventCreateEventCreateEvent legt ein Eventobjekt an und initialisiert es entsprechend der Attribute, die über die Parameter AttribNameAttribNameAttribNameAttribNameattribName und AttribValueAttribValueAttribValueAttribValueattribValue gesetzt werden. AttribNameAttribNameAttribNameAttribNameattribName definiert die Klasse und AttribValueAttribValueAttribValueAttribValueattribValue 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

AttribNameAttribNameAttribNameAttribNameattribName (input_control)  attribute.name(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Event-Attribut.

Defaultwert: []

Werteliste: '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)

Event-Attributwert.

Parameteranzahl: AttribValue == AttribName

Defaultwert: []

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

EventHandleEventHandleEventHandleEventHandleeventHandle (output_control)  event HEvent, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Event-Synchronisationsobjekt.

Ergebnis

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

Nachfolger

wait_eventwait_eventWaitEventWaitEventWaitEvent, signal_eventsignal_eventSignalEventSignalEventSignalEvent, clear_eventclear_eventClearEventClearEventClearEvent

Siehe auch

clear_eventclear_eventClearEventClearEventClearEvent

Modul

Foundation