LockHandle<TMutex> Interface

    Package: @esfx/async-lockable

    An object used to release a held lock.

    Declaration
    export interface LockHandle<TMutex extends AsyncLockable = AsyncLockable> extends Disposable, AsyncLockable 
    Inheritance
    Disposable
    AsyncLockable
    LockHandle<TMutex>
    Inherited Members
    [Disposable.dispose]()
    [AsyncLockable.lock](cancelable)
    [AsyncLockable.unlock]()

    Properties

    mutex

    Gets the associated AsyncLockable object.

    Declaration
    readonly mutex: TMutex;
    Property Value
    TMutex

    ownsLock

    Indicates whether this handle owns its associated mutex.

    Declaration
    readonly ownsLock: boolean;
    Property Value
    boolean

    Methods

    lock(cancelable)

    Reacquires the lock. If this handle already owns the lock, an Error is thrown.

    Declaration
    lock(cancelable?: Cancelable): Promise<this>;
    Parameters
    cancelable
    Cancelable

    A Cancelable used to cancel the request.

    Returns
    Promise<this>

    unlock()

    Releases the lock. If this handle does not own the lock, an Error is thrown.

    Declaration
    unlock(): void;
    Returns
    void

    Generated by DocFX