MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / withLockAsync

Method withLockAsync

src/utils.ts:645–652  ·  view source on GitHub ↗

* Execute an async function while holding the lock

(fn: () => Promise<T>)

Source from the content-addressed store, hash-verified

643 * Execute an async function while holding the lock
644 */
645 async withLockAsync<T>(fn: () => Promise<T>): Promise<T> {
646 this.acquire();
647 try {
648 return await fn();
649 } finally {
650 this.release();
651 }
652 }
653
654 /**
655 * Check if a process is still running

Callers 1

security.test.tsFile · 0.80

Calls 3

acquireMethod · 0.95
releaseMethod · 0.95
fnFunction · 0.50

Tested by

no test coverage detected