MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / release

Method release

src/pkg/utils/concurrency-control.ts:17–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 }
16
17 release() {
18 if (this.active > 0) {
19 const next = this.queue.shift();
20 if (next) {
21 next();
22 return;
23 }
24 this.active--;
25 } else {
26 console.warn("Semaphore double release detected");
27 }
28 }
29}
30
31type TWithTimeoutNotifyResult<T> = {

Callers 4

taskFunction · 0.80
runFunction · 0.80
releaseSlotOnceMethod · 0.80

Calls 2

nextFunction · 0.85
warnMethod · 0.80

Tested by 2

taskFunction · 0.64
runFunction · 0.64