waitUntilTrueWithInterruption
Blocks the current thread until monitorSatisfied returns true. This method can be interrupted.
Throws
if the thread is interrupted while waiting.
Blocks the current thread until monitorSatisfied returns true or the timeout expires. This method can be interrupted.
Return
true if the condition was satisfied, false if the wait timed out.
Parameters
the maximum duration to wait. A zero or negative duration checks the condition once.
Throws
if the thread is interrupted while waiting.
The timed waitUntilTrueWithInterruption for Java callers: the overload taking a Kotlin Duration is compiled under a mangled name that Java cannot call.
Return
true if the condition was satisfied, false if the wait timed out.
Parameters
the maximum duration to wait. A zero or negative duration checks the condition once.
Throws
if the thread is interrupted while waiting.
Repeatedly waits (interruptibly) for the condition to become true, invoking block on each timeout.
Return
true if the condition was satisfied, false if the block returned false.
Parameters
the duration of each wait attempt; at least 1 ms.
the action invoked on each timeout; return false to stop waiting.
Throws
if the thread is interrupted while waiting.
if timeout is shorter than 1 ms.
Repeatedly waits (interruptibly) for the condition to become true, invoking block on each timeout, up to an overall maximum wait duration.
Return
true if the condition was satisfied, false if maxWait elapsed or block returned false.
Parameters
the duration of each wait attempt; at least 1 ms.
the overall maximum duration to wait; see GenericMonitor for its limits.
the action invoked on each timeout; return false to stop waiting. May be null.
Throws
if the thread is interrupted while waiting.
if timeout is shorter than 1 ms.
The retrying waitUntilTrueWithInterruption for Java callers; see the java.time.Duration waitUntilTrueWithInterruption.
Return
true if the condition was satisfied, false if the block returned false.
Parameters
the duration of each wait attempt; at least 1 ms.
the action invoked on each timeout; return false to stop waiting.
Throws
if the thread is interrupted while waiting.
if timeout is shorter than 1 ms.
The retrying waitUntilTrueWithInterruption with an overall limit, for Java callers; see the java.time.Duration waitUntilTrueWithInterruption. A maxWait too long for a Kotlin Duration, such as java.time.Duration.ofSeconds(Long.MAX_VALUE), waits without limit.
Return
true if the condition was satisfied, false if maxWait elapsed or block returned false.
Parameters
the duration of each wait attempt; at least 1 ms.
the overall maximum duration to wait; see GenericMonitor for its limits.
the action invoked on each timeout; return false to stop waiting. May be null.
Throws
if the thread is interrupted while waiting.
if timeout is shorter than 1 ms.