ConditionVariable class
A ConditionVariable is a synchronization primitive that allows to wait
for a particular condition to become true before proceeding.
It is always used in conjunction with a locking to safely manage access to
the shared data and prevent race conditions.
Constructors
- ConditionVariable(Lock lock)
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → Future< void> -
Removes an element from the wait queue and waits for the lock to be
acquired.
After the locks acquired, schedules the action specified in the removed from the queue element to run. -
notifyAll(
) → Future< void> -
Removes all elements from the wait queue and waits for the lock to be
acquired for each element separately.
After the locks acquired, schedules the actions specified in the removed from the queue elements to run. -
toString(
) → String -
A string representation of this object.
inherited
-
tryWait(
Duration timeout) → Future< bool> -
Releases the lock and waits for a notification.
Upon receiving the notification, the lock will be reacquired. Accordingly, upon exiting the method, the locked code will be entered. -
wait(
) → Future< void> -
Releases the lock and waits for a notification.
Upon receiving the notification, the lock will be reacquired. Accordingly, upon exiting the method, the locked code will be entered.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited