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

Method withLockAsync

src/utils.ts:621–628  ·  view source on GitHub ↗

* Execute an async function while holding the lock

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

Source from the content-addressed store, hash-verified

619 * Execute an async function while holding the lock
620 */
621 async withLockAsync<T>(fn: () => Promise<T>): Promise<T> {
622 this.acquire();
623 try {
624 return await fn();
625 } finally {
626 this.release();
627 }
628 }
629
630 /**
631 * 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