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

Method withLock

src/utils.ts:633–640  ·  view source on GitHub ↗

* Execute a function while holding the lock

(fn: () => T)

Source from the content-addressed store, hash-verified

631 * Execute a function while holding the lock
632 */
633 withLock<T>(fn: () => T): T {
634 this.acquire();
635 try {
636 return fn();
637 } finally {
638 this.release();
639 }
640 }
641
642 /**
643 * 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