AsyncMutexUtils class

Async mutex: only one holder at a time.

Constructors

AsyncMutexUtils()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

acquire() Future<void>
Waits until the mutex is available, then acquires it. Completes when the mutex is acquired. Throws Object if the underlying future completes with an error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() → void
Releases the mutex; unblocks one waiter if any.
run<T>(AsyncAction<T> fn) Future<T>
Acquires the mutex, runs fn, then releases; ensures release on exception.
toString() String
A string representation of this object.
override
tryLock() bool
Acquires the mutex immediately if not locked; returns false if already held.

Operators

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