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

Function locked

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

Source from the content-addressed store, hash-verified

606 * @since 2.0.0
607 */
608export const locked = (self: TxReentrantLock): Effect.Effect<boolean> =>
609 Effect.gen(function*() {
610 const state = yield* TxRef.get(self.stateRef)
611 return HashMap.size(state.readers) > 0 || Option.isSome(state.writer)
612 })
613
614/**
615 * Checks whether any fiber holds a read lock.

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
sizeMethod · 0.65

Tested by

no test coverage detected