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

Function writeLock

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

Source from the content-addressed store, hash-verified

398 * @since 2.0.0
399 */
400export const writeLock = (self: TxReentrantLock): Effect.Effect<number, never, Scope.Scope> =>
401 Effect.withFiber((fiber) =>
402 Effect.acquireRelease(
403 acquireWrite(self),
404 () => releaseWriteFor(self, fiber.id)
405 )
406 )
407
408/**
409 * Runs the provided effect while holding a read lock. The lock is automatically

Callers

nothing calls this directly

Calls 2

acquireWriteFunction · 0.85
releaseWriteForFunction · 0.85

Tested by

no test coverage detected