Mutex class

Simple but the best Mutex providing a exclusive write lock and shared read-only locks.

Constructors

Mutex()

Properties

hashCode int
The hash code for this object.
no setterinherited
isLocked bool
For test only.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sharedCount int
For test only.
no setter

Methods

critical<T>(FutureOr<T> func(), {Duration? timeLimit}) Future<T>
Critical section with lock and unlock.
criticalShared<T>(FutureOr<T> func(), {Duration? timeLimit}) Future<T>
Critical section with lockShared and unlockShared.
lock({Duration? timeLimit}) Future<void>
Aquires the exclusive lock.
lockShared({Duration? timeLimit}) Future<void>
Aquires a shared lock.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unlock() → void
Releases the exclusive lock.
unlockShared() → void
Releases a shared lock.

Operators

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