diff --git a/web-locks.js b/web-locks.js index b810bc7..ae40d86 100644 --- a/web-locks.js +++ b/web-locks.js @@ -26,7 +26,9 @@ class Lock { return new Promise(resolve => { this.queue.push({ handler, resolve }); this.trying = true; - this.tryEnter(); + setTimeout(() => { + this.tryEnter(); + }, 0); }); }