A non-blocking synchronization primitive that can be used for mutual exclusion across contexts.

Objects that implement this interface should guarantee that all operations are atomic. Implementations do not have to guarantee that acquiring a lock is first-come, first serve.


Mutex::acquire(): \Generator

Acquires a lock on the mutex.


Coroutine: Calls to this function must be preceded with yield within another coroutine or wrapped with new Coroutine() to create an awaitable.

Resolution value

Lock object which can be used to release the acquired.
Next: Sync\Parcel