Skip to content

Commit

Permalink
Improve deadlock behaviour
Browse files Browse the repository at this point in the history
PR-URL: #18
  • Loading branch information
tshemsedinov committed Mar 15, 2020
1 parent 54e82e3 commit 342bbd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web-locks.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class Lock {
return new Promise(resolve => {
this.queue.push({ handler, resolve });
this.trying = true;
this.tryEnter();
setTimeout(() => {
this.tryEnter();
}, 0);
});
}

Expand Down

0 comments on commit 342bbd5

Please sign in to comment.