Acquires the lock as soon as possible.
a Promise that resolves once the lock has been acquired
Acquires the lock, awaits an asynchronous action, and ensures that the lock is released.
an asynchronous function
the function's return value.
Releases the lock. If someone else was waiting on an acquire, they will now acquire it (first come first served). This simple implementation does not verify that you were the one who had actually acquired the lock.
Generated using TypeDoc
A simple asynchronous lock that can be held by one task at a time.
This is a naive implementation that is meant for simple cases where two pieces of async test logic must not be run in parallel because they use the same resource.