MultiLock class

A multi lock that locks multiple locks at the same time.

Implemented types

Constructors

MultiLock.new({required Iterable<Lock> locks})
Creates a new multi lock.

Properties

canLock bool
It returns true if the lock can be locked. For basic lock (reentrant or not), it is when the lock is not locked.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
inLock bool
for reentrant, test whether we are currently in the synchronized section. for non reentrant, it returns the locked status.
no setteroverride
locked bool
returns true if the lock is currently locked.
no setteroverride
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
synchronized<T>(FutureOr<T> computation(), {Duration? timeout}) Future<T>
Executes computation when lock is available.
override
toString() String
A string representation of this object.
inherited

Operators

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