ReentrantLock class
A ReentrantLock is a synchronization primitive that works like a mutex.
It blocks execution of all zones that do not own this lock.
The zone that acquired the permit becomes the owner of this lock.
The zone owner can enter and exit as long as it holds this lock.
Constructors
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> -
Acquire a
lock.override -
lock(
FutureOr< void> action()) → Future<void> -
Acquires the
lock, then executes the callback functionaction, and then releases thelock.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reacquire(
) → Future< void> -
Reacquire a
lock.override -
release(
) → Future< void> -
Releases a
lock.override -
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.override -
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.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited