Lock class abstract
A Lock is an abstract interface that can be used to implement unified mutual-exclusion synchronization primitives.
Unified mutual-exclusion synchronization primitives are objects with the following members:
- Implementers
Constructors
- Lock()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
acquire(
) → Future< void> -
Acquires the
lock. -
lock(
FutureOr< void> action()) → Future<void> -
Acquires the
lock, then executes the callback functionaction, and then releases thelock. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reacquire(
) → Future< void> - Reacquires the lock as quickly as possible.
-
release(
) → Future< void> -
Releases the
lock. -
toString(
) → String -
A string representation of this object.
inherited
-
tryAcquire(
Duration timeout) → Future< bool> -
Tries to acquire the
lockand returnstrueif thelockwas acquired before thetimeoutexpires, otherwise the acquisition attempt is canceled andfalseis returned. -
tryLock(
Duration timeout, FutureOr< void> action()) → Future<bool> -
Tries to acquire the
lockto execute anactionand returnstrueif thelockwas acquired before thetimeoutexpires, otherwise the acquisition attempt is canceled andfalseis returned.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited