try_wait_eventT_try_wait_eventTryWaitEventTryWaitEventtry_wait_event (Operator)

Name

try_wait_eventT_try_wait_eventTryWaitEventTryWaitEventtry_wait_event — Lock an event synchronization object only if it is unlocked.

Signature

try_wait_event( : : EventHandle : Busy)

Herror T_try_wait_event(const Htuple EventHandle, Htuple* Busy)

void TryWaitEvent(const HTuple& EventHandle, HTuple* Busy)

Hlong HEvent::TryWaitEvent() const

static void HOperatorSet.TryWaitEvent(HTuple eventHandle, out HTuple busy)

int HEvent.TryWaitEvent()

def try_wait_event(event_handle: HHandle) -> int

Description

try_wait_eventtry_wait_eventTryWaitEventTryWaitEventtry_wait_event behaves identically to wait_eventwait_eventWaitEventWaitEventwait_event, except that it does not block the calling thread when waiting until the object is signaled but returns immediately. The state of the event before entering try_wait_eventtry_wait_eventTryWaitEventTryWaitEventtry_wait_event is returned in BusyBusyBusybusybusy. 1 indicates that the event was non-signaled before calling try_wait_eventtry_wait_eventTryWaitEventTryWaitEventtry_wait_event, 0 that the event was signaled.

Execution Information

Parameters

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

Event synchronization object.

BusyBusyBusybusybusy (output_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Object already locked?

Result

If the event handle is valid, the operator try_wait_eventtry_wait_eventTryWaitEventTryWaitEventtry_wait_event returns 2 ( H_MSG_TRUE) . If necessary, an exception is raised.

Possible Predecessors

create_eventcreate_eventCreateEventCreateEventcreate_event

Possible Successors

signal_eventsignal_eventSignalEventSignalEventsignal_event

See also

wait_eventwait_eventWaitEventWaitEventwait_event

Module

Foundation