@ac-essentials/misc-util
    Preparing search index...

    Interface ILock

    Interface representing a lockable resource.

    A lockable resource can be acquired and released to control access.

    interface ILock {
        locked: boolean;
        lock(signal?: AbortSignal | null): Promisable<void>;
        tryLock(): Promisable<boolean>;
        unlock(): Promisable<void>;
    }

    Implemented by

    Index

    Properties

    Methods

    Properties

    locked: boolean

    Indicates whether the lock is currently held.

    Methods

    • Acquires the lock, waiting if necessary until it is available.

      Parameters

      • Optionalsignal: AbortSignal | null

        An optional AbortSignal to cancel the acquire operation.

      Returns Promisable<void>

      A promise that resolves when the lock is acquired.