UnfairLock class
An UnfairLock object is identical to a Lock excepts that it wakes up the last future that called acquire instead of the first (i.e. waiting futures are put in a LIFO queue).
Constructors
- UnfairLock()
- Create a new UnfairLock object.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- locked → bool
-
Whether this lock is acquired.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- waiters → int
-
Number of futures which are currently waiting to acquire this lock.
no setterinherited
Methods
-
acquire(
) → Future< void> -
Acquire the lock. If the lock has already been acquired then this method will wait
asynchronously until the lock is released.
inherited
-
cancelAll(
) → void -
Cancel all futures waiting for this lock to be available by throwing a
LockAcquireFailureException to them.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → void -
Release the lock. If the lock isn't acquired then this method does nothing.
inherited
-
run<
T> (Future< T> func()) → Future<T> -
Acquire the lock, asynchronously run
func
and release the lock afterwards.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited