(self: TxReentrantLock)
| 552 | * @since 2.0.0 |
| 553 | */ |
| 554 | export const readLocks = (self: TxReentrantLock): Effect.Effect<number> => |
| 555 | Effect.gen(function*() { |
| 556 | const state = yield* TxRef.get(self.stateRef) |
| 557 | let total = 0 |
| 558 | for (const [, count] of state.readers) { |
| 559 | total += count |
| 560 | } |
| 561 | return total |
| 562 | }) |
| 563 | |
| 564 | /** |
| 565 | * Returns the number of write locks held (0 or the reentrant count). |