AutoResetEvent Class

    Package: @esfx/threading-autoresetevent
    Declaration
    export declare class AutoResetEvent implements Disposable 

    Constructors

    constructor(initialState)

    Constructs a new instance of the AutoResetEvent class

    Declaration
    constructor(initialState?: boolean);
    Parameters
    initialState
    boolean

    constructor(buffer, byteOffset)

    Constructs a new instance of the AutoResetEvent class

    Declaration
    constructor(buffer: SharedArrayBuffer, byteOffset?: number);
    Parameters
    buffer
    SharedArrayBuffer

    byteOffset
    number

    Properties

    buffer

    Gets the SharedArrayBuffer for this event.

    Declaration
    get buffer(): SharedArrayBuffer;
    Property Value
    SharedArrayBuffer

    byteLength

    Gets the number of bytes occupied by this event in its buffer.

    Declaration
    get byteLength(): number;
    Property Value
    number

    byteOffset

    Gets the byte offset of this event in its buffer.

    Declaration
    get byteOffset(): number;
    Property Value
    number

    SIZE

    Declaration
    static readonly SIZE = 4;

    Methods

    [Disposable.dispose]()

    Releases all resources for this event.

    Declaration
    [Disposable.dispose](): void;
    Returns
    void

    close()

    Releases all resources for this event.

    Declaration
    close(): void;
    Returns
    void

    reset()

    Sets the state of the event to nonsignaled, causing any threads waiting on the event to block.

    Declaration
    reset(): boolean;
    Returns
    boolean

    true if the event was reset; otherwise, false.

    set()

    Sets the state of the event to signaled, allowing the next thread waiting on the event to proceed.

    Declaration
    set(): boolean;
    Returns
    boolean

    true if the event was set; otherwise, false.

    waitOne(ms)

    Blocks the current thread until this event becomes signaled.

    Declaration
    waitOne(ms?: number): boolean;
    Parameters
    ms
    number

    The number of milliseconds to wait.

    Returns
    boolean

    true if the event was signaled before the timeout expired; otherwise, false.

    Generated by DocFX