Skip to content

try_wait_eventTryWaitEventTryWaitEventtry_wait_eventT_try_wait_event🔗

Short description🔗

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

Signature🔗

try_wait_event( event EventHandle, out number Busy )void TryWaitEvent( const HTuple& EventHandle, HTuple* Busy )static void HOperatorSet.TryWaitEvent( HTuple eventHandle, out HTuple busy )def try_wait_event( event_handle: HHandle ) -> int

Herror T_try_wait_event( const Htuple EventHandle, Htuple* Busy )

Hlong HEvent::TryWaitEvent( ) const

int HEvent.TryWaitEvent( )

Description🔗

try_wait_eventTryWaitEvent behaves identically to wait_eventWaitEvent, 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_eventTryWaitEvent is returned in Busybusybusy. 11 indicates that the event was non-signaled before calling try_wait_eventTryWaitEvent, 00 that the event was signaled.

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🔗

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

Event synchronization object.

Busybusybusy (output_control) number → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Object already locked?

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

create_eventCreateEvent

Possible successors

signal_eventSignalEvent

See also

wait_eventWaitEvent

Module🔗

Foundation