BasicLock class
Basic (non-reentrant) lock
- Implemented types
- Available extensions
Constructors
Properties
- canLock → bool
-
Whether calling synchronized right now would be able to acquire the
lock without waiting.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- inLock → bool
-
For a reentrant lock, whether the current Zone is nested inside a
synchronized call on this lock (so a further nested call would not
deadlock).
no setteroverride
- last ↔ Future?
-
The last running block
getter/setter pair
- locked → bool
-
Whether the lock is currently held, i.e. a call to synchronized is
currently running (or waiting for a nested synchronized call to
finish, for a reentrant lock).
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> -
Runs
computationonce this lock is available, preventing any other call to synchronized on this lock from running concurrently.override -
synchronizedSync<
T> (T computation(), {Duration? timeout}) → FutureOr< T> -
Available on Lock, provided by the TekartikLockExtension extension
Runs the synchronouscomputation, returning its result directly (not wrapped in a Future) if this lock can be acquired immediately (see Lock.canLock). -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited