GenericValueWaiter

abstract class GenericValueWaiter<T>(initValue: T)

Abstract coroutine-based waiter that suspends callers until a per-call condition is satisfied.

Each call to waitForCondition registers its own predicate and continuation, so any number of coroutines may wait concurrently — each on a possibly-different condition — and each is resumed independently. checkCondition updates the monitored value and resumes every registered waiter whose predicate is now satisfied.

It is abstract by design — a base class for typed waiters (such as BooleanWaiter) that expose the protected waitForCondition through their own typed wait methods — even though it declares no abstract members, since each wait supplies its own predicate.

Parameters

initValue

the initial value.

Type Parameters

T

the type of the monitored value.

Inheritors

Constructors

Link copied to clipboard
constructor(initValue: T)

Functions

Link copied to clipboard
fun checkCondition(value: T)

Updates the monitored value and resumes every waiting coroutine whose predicate is now satisfied.