MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / createLock

Method createLock

src/misc.ts:381–396  ·  view source on GitHub ↗
(pending: boolean, ready: Promise<void> | null)

Source from the content-addressed store, hash-verified

379 }
380
381 private createLock(pending: boolean, ready: Promise<void> | null): AsyncMutexLock {
382 let released = false;
383
384 return {
385 pending,
386 ready,
387 release: () => {
388 if (released) return;
389 released = true;
390 this.dispatch();
391 },
392 [Symbol.dispose]() {
393 this.release();
394 },
395 };
396 }
397
398 private dispatch() {
399 if (this.resolverQueue.length > 0) {

Callers 1

lockMethod · 0.95

Calls 1

dispatchMethod · 0.95

Tested by

no test coverage detected