BasicLock class

Basic (non-reentrant) lock

Implemented types
Available extensions

Constructors

BasicLock()

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
last Future?
The last running block
getter/setter pair
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> func(), {Duration? timeout}) Future<T>
Executes computation when lock is available.
override
synchronizedSync<T>(T computation(), {Duration? timeout}) FutureOr<T>

Available on Lock, provided by the TekartikLockExtension extension

Executes a synchronous computation. If the lock is not locked, it will run the computation immediately and return its value synchronously.
toString() String
A string representation of this object.
override

Operators

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