Creates a mutex that when acquired will return a lock that needs to be released before any waiting code can be run.

Hierarchy

  • default

Constructors

Properties

Methods

Constructors

Properties

#onRelease?: default<unknown>

Methods

  • Acquires a lock on this mutex. Only one lock can be kept at a time; calling multiple times will create dependent locks

    Parameters

    • cancellationToken: default = CancellationToken.default

    Returns Promise<Lock>

  • Returns a promise that can be awaited until the lock is released. If there is no lock the promise is resolved immediately.

    Parameters

    • cancellationToken: default = CancellationToken.default

    Returns Promise<void>

Generated using TypeDoc