Function Mutexed

  • Internal

    This serializes access to an underlying async filesystem. For example, on an OverlayFS instance with an async lower directory operations like rename and rmdir may involve multiple requests involving both the upper and lower filesystems -- they are not executed in a single atomic step. OverlayFS uses this to avoid having to reason about the correctness of multiple requests interleaving.

    Note: @ts-expect-error 2513 is needed because FS is not properly detected as being concrete

    Type Parameters

    Parameters

    • FS: T

    Returns Mixin<T, {
        isLocked(path): boolean;
        lock(path, syscall): Promise<MutexLock>;
        lockSync(path): MutexLock;
    }>

    Todo

    Change using _ to using void pending https://github.com/tc39/proposal-discard-binding