MCPcopy Create free account
hub / github.com/tiann/hapi / lock

Method lock

cli/src/utils/lock.ts:14–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 }
13
14 private async lock() {
15 if (this.permits > 0) {
16 this.permits = this.permits - 1;
17 return;
18 }
19 await new Promise<boolean>(resolve => this.promiseResolverQueue.push(resolve));
20 }
21
22 private unlock() {
23 this.permits += 1;

Callers 1

inLockMethod · 0.95

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected