Locks this Mutex. Calling await mutex.acquire() on an unlocked Mutex
returns immediately. Calling it on a locked Mutex awaits until the Mutex
is released. Calling await mutex.acquire(lock) with the lock that is
holding the Mutex returns immediately and returns the same lock, which is
useful, for example, in recursive algorithms.
Optionallock: Lock
An optional Lock that will be used to hold the Mutex.
The Lock currently holding the locked Mutex.
Releases this Mutex. Called either directly or by the Lock holding the Mutex as it gets disposed.
A mutex for enforcing execution order in asynchronous code.
Example