MCPcopy Index your code
hub / github.com/anomalyco/opencode / lock

Function lock

packages/opencode/src/tool/edit.ts:37–45  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

35const locks = new Map<string, Semaphore.Semaphore>()
36
37function lock(filePath: string) {
38 const resolvedFilePath = FSUtil.resolve(filePath)
39 const hit = locks.get(resolvedFilePath)
40 if (hit) return hit
41
42 const next = Semaphore.makeUnsafe(1)
43 locks.set(resolvedFilePath, next)
44 return next
45}
46
47export const Parameters = Schema.Struct({
48 filePath: Schema.String.annotate({ description: "The absolute path to the file to modify" }),

Callers 4

edit.tsFile · 0.70
AppFunction · 0.50
flipFunction · 0.50
ViewFunction · 0.50

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected