MCPcopy
hub / github.com/colbymchenry/codegraph / withLockAsync

Method withLockAsync

src/utils.ts:313–320  ·  view source on GitHub ↗

* Execute an async function while holding the lock

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

Source from the content-addressed store, hash-verified

311 * Execute an async function while holding the lock
312 */
313 async withLockAsync<T>(fn: () => Promise<T>): Promise<T> {
314 this.acquire();
315 try {
316 return await fn();
317 } finally {
318 this.release();
319 }
320 }
321
322 /**
323 * 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