var _a;

import * as tsplus_module_1 from "@tsplus/stdlib/collections/HashMap/values";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/Chunk/definition";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Chunk/reduce";
import * as tsplus_module_4 from "@tsplus/stdlib/collections/HashMap/get";
import * as tsplus_module_5 from "@tsplus/stdlib/data/Maybe/getOrElse";
import { ReadLockSym } from "@effect/core/stm/TReentrantLock/definition/ReadLock";
export class InternalReadLock {
  constructor(readers) {
    this.readers = readers;
    this[_a] = ReadLockSym;
    this.writeLocks = 0;
  }

  writeLocksHeld(fiberId) {
    return 0;
  }

  get readLocks() {
    return tsplus_module_3.reduce_(tsplus_module_2.from(tsplus_module_1.values(this.readers)), 0, (s, a) => s + a);
  }

  readLocksHeld(fiberId) {
    return tsplus_module_5.getOrElse_(tsplus_module_4.get_(this.readers, fiberId), () => 0);
  }

}
_a = ReadLockSym;
/**
 * @tsplus macro remove
 */

export function concreteReadLock(_) {//
}
//# sourceMappingURL=InternalReadLock.mjs.map