Class EqualReadWriteLocker

A ReadWriteLocker that gives no priority to read or write operations: both use the same lock.

Hierarchy

Implements

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Run the given function while the resource is locked. The lock will be released when the (async) input function resolves. This function should be used for operations that only require reading the resource.

    Type Parameters

    • T

    Parameters

    Returns Promise<T>

    A promise resolving when the lock is released.

  • Run the given function while the resource is locked. The lock will be released when the (async) input function resolves. This function should be used for operations that could modify the resource.

    Type Parameters

    • T

    Parameters

    Returns Promise<T>

    A promise resolving when the lock is released.