MCPcopy Create free account
hub / github.com/Effect-TS/effect / writeLocks

Function writeLocks

packages/effect/src/TxReentrantLock.ts:583–587  ·  view source on GitHub ↗
(self: TxReentrantLock)

Source from the content-addressed store, hash-verified

581 * @since 2.0.0
582 */
583export const writeLocks = (self: TxReentrantLock): Effect.Effect<number> =>
584 Effect.gen(function*() {
585 const state = yield* TxRef.get(self.stateRef)
586 return Option.isSome(state.writer) ? state.writer.value[1] : 0
587 })
588
589/**
590 * Checks whether the lock is held by any fiber (read or write).

Callers

nothing calls this directly

Calls 1

getMethod · 0.65

Tested by

no test coverage detected