Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventWaitHandle

A thread synchronization event.

Hierarchy

Index

Constructors

  • Initializes a new EventWaitHandle specifying whether the wait handle is initially signaled and whether it should reset automatically or manually.

    Parameters

    • initialState: boolean

      true to set the initial state to signaled; false to set it to non-signaled.

    • mode: EventResetMode

      An EventResetMode value that determines whether the event resets automatically or manually.

    Returns EventWaitHandle

Properties

#private: any
isSignaled: boolean

Methods

  • notify(count: number): number
  • Notifies a given number of awaiting coroutines that are waiting on the current wait handle.

    Parameters

    • count: number

      The number of awaiting coroutines to notify.

    Returns number

    The number of awaiting coroutines that were notified.

  • reset(): boolean
  • Sets the state of the event to nonsignaled, causing coroutines to enter an awaiting state.

    Returns boolean

    true if the operation succeeded; otherwise false.

  • set(): boolean
  • Sets the state of the event to signaled, allowing one or more awaiting coroutines to proceed.

    Returns boolean

    true if the operation succeeded; otherwise false.

  • wait(abortSignal?: AbortSignal): Promise<void>
  • Waits for the current {@link @aitHandle} to receive a signal.

    Parameters

    • Optional abortSignal: AbortSignal

      An optional AbortSignal that will abort the current wait operation.

    Returns Promise<void>

    A Promise that resolves when the current WaitHandle receives a signal.

Generated using TypeDoc