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

Function readLock

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

Source from the content-addressed store, hash-verified

361 * @since 2.0.0
362 */
363export const readLock = (self: TxReentrantLock): Effect.Effect<number, never, Scope.Scope> =>
364 Effect.withFiber((fiber) =>
365 Effect.acquireRelease(
366 acquireRead(self),
367 () => releaseReadFor(self, fiber.id)
368 )
369 )
370
371/**
372 * Acquires a write lock for the duration of the scope.

Callers

nothing calls this directly

Calls 2

acquireReadFunction · 0.85
releaseReadForFunction · 0.85

Tested by

no test coverage detected