MCPcopy Create free account
hub / github.com/Botloader/botloader / lock

Method lock

components/runtime/src/ts/core_util.ts:198–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196 private waiting: ((arg: any) => any)[] = []
197
198 private async lock() {
199 if (this.locked) {
200 await new Promise((complete) => {
201 if (!this.locked) {
202 this.locked = true
203 complete(null)
204 } else {
205 this.waiting.push(complete)
206 }
207 })
208 } else {
209 this.locked = true
210 }
211 }
212
213 private unlock() {
214 let next = this.waiting.shift()

Callers 11

withLockedMethod · 0.95
inner_get_workerMethod · 0.80
return_workerMethod · 0.80
add_worker_to_poolMethod · 0.80
add_pending_workerMethod · 0.80
gen_idMethod · 0.80
worker_connectedMethod · 0.80
worker_statusesMethod · 0.80
complete_jobsMethod · 0.80
job_completedMethod · 0.80
trigger_jobsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected