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

Method withLock

src/utils.ts:301–308  ·  view source on GitHub ↗

* Execute a function while holding the lock

(fn: () => T)

Source from the content-addressed store, hash-verified

299 * Execute a function while holding the lock
300 */
301 withLock<T>(fn: () => T): T {
302 this.acquire();
303 try {
304 return fn();
305 } finally {
306 this.release();
307 }
308 }
309
310 /**
311 * Execute an async function while holding the lock

Callers

nothing calls this directly

Calls 3

acquireMethod · 0.95
releaseMethod · 0.95
fnFunction · 0.50

Tested by

no test coverage detected