AsyncRwLock class

Async multi-reader / single-writer lock.

Writers hold an exclusive lock; readers hold a shared lock. New writers block until all existing readers have released; new readers queued behind a waiting writer also block, which keeps writers from starving.

Constructors

AsyncRwLock()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isBusy → bool
Test-only: returns true if the lock is currently held or contended.
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
read<T>(FutureOr<T> body()) → Future<T>
Run body under a shared (read) lock. Multiple readers may run concurrently. The lock is released even if body throws.
toString() → String
A string representation of this object.
inherited
write<T>(FutureOr<T> body()) → Future<T>
Run body under an exclusive (write) lock.

Operators

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