Promise-based lock implementation.
When someone tries to acquire a Lock they receive a promise for a release callback that is fulfilled as soon as previous lock owner invokes their release callback.
https://en.wikipedia.org/wiki/Lock_(computer_science) Lock (computer science)
true if Lock was acquired and wasn't released yet.
true
Waits for the Lock to become available and fulfills it with the callback that releases the lock.
Promise-based lock implementation.
When someone tries to acquire a Lock they receive a promise for a release callback that is fulfilled as soon as previous lock owner invokes their release callback.
See
https://en.wikipedia.org/wiki/Lock_(computer_science) Lock (computer science)