Lockable Interface

    Package: @esfx/threading-lockable
    Declaration
    export interface Lockable 

    Methods

    [Lockable.lock](ms)

    Takes an exclusive lock.

    Declaration
    [Lockable.lock](ms?: number): boolean;
    Parameters
    ms
    number

    The number of milliseconds to wait for the lock.

    Returns
    boolean

    true if the current thread now owns the lock; otherwise, false.

    [Lockable.tryLock]()

    Attempts to take an exclusive lock without waiting.

    Declaration
    [Lockable.tryLock]?(): boolean;
    Returns
    boolean

    true if the current thread now owns the lock; otherwise, false.

    [Lockable.unlock]()

    Releases the exclusive lock.

    Declaration
    [Lockable.unlock](): boolean;
    Returns
    boolean

    true if the current thread previously owned the lock and the lock could be released; otherwise, false.

    Generated by DocFX