MCPcopy Create free account
hub / github.com/Kevin7Qi/codex-collab / withThreadLock

Function withThreadLock

src/threads.ts:40–47  ·  view source on GitHub ↗
(filePath: string, fn: () => T)

Source from the content-addressed store, hash-verified

38
39/** Acquire the thread file lock, run fn, then release. */
40export function withThreadLock<T>(filePath: string, fn: () => T): T {
41 const release = acquireLock(filePath);
42 try {
43 return fn();
44 } finally {
45 release();
46 }
47}
48
49// ─── Short ID generation ───────────────────────────────────────────────────
50

Callers 6

mutateThreadIndexFunction · 0.85
registerThreadFunction · 0.85
removeThreadFunction · 0.85
ensureLedgerVersionFunction · 0.85
migrateGlobalStateFunction · 0.85
removeLegacyGlobalThreadFunction · 0.85

Calls 1

acquireLockFunction · 0.85

Tested by

no test coverage detected