MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / withLock

Function withLock

bin/mcp-server.js:167–174  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

165
166let runLock = Promise.resolve()
167async function withLock(fn) {
168 const prev = runLock
169 let release
170 runLock = new Promise(r => (release = r))
171 await prev
172 try { return await fn() }
173 finally { release() }
174}
175
176async function withSilencedIO(fn) {
177 const origOut = process.stdout.write.bind(process.stdout)

Callers 1

mcp-server.jsFile · 0.70

Calls 2

fnFunction · 0.50
releaseFunction · 0.50

Tested by

no test coverage detected