AsyncMutex class final

A non-reentrant asynchronous lock that runs critical sections one at a time, in the order protect was called.

Used to serialise read-modify-write cycles on shared state, such as the vault's account index, so that concurrent writers cannot lose updates. It only coordinates code within one isolate; it does not protect against other isolates or processes. Calling protect from inside a protected section deadlocks.

Constructors

AsyncMutex()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isLocked → bool
Whether a critical section is running or waiting to run.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
protect<T>(FutureOr<T> action()) → Future<T>
Runs action once every earlier critical section has finished and returns its result.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited