X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FAsyncLock.ts;h=9c0584565e3ecb80897b2ad32418a1afdb0cc888;hb=b85cef4cba7e4d2294940aef29a9f74edf800dac;hp=b396e49b50901fae636f565198f73dddc0b58c09;hpb=e1d9a0f4d6ff1a90048e9a694fd12b7031cc6961;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/AsyncLock.ts b/src/utils/AsyncLock.ts index b396e49b..9c058456 100644 --- a/src/utils/AsyncLock.ts +++ b/src/utils/AsyncLock.ts @@ -25,7 +25,7 @@ export class AsyncLock { asyncLock.acquired = true; return; } - return new Promise((resolve) => { + return new Promise((resolve) => { asyncLock.resolveQueue.enqueue(resolve); }); } @@ -37,7 +37,7 @@ export class AsyncLock { return; } const queuedResolve = asyncLock.resolveQueue.dequeue()!; - return new Promise((resolve) => { + return new Promise((resolve) => { queuedResolve(); resolve(); });