spinWaitBoundedUntil

inline fun Spinner.spinWaitBoundedUntil(condition: () -> Boolean): Boolean

Waits in the spin-loop until the given condition is true. Exits the spin-loop after a certain number of spin-loop iterations --- typically, in this case, one may want to fall back into some blocking synchronization.

Return

true if the condition is met; false if the condition was not met and the spin-wait loop exited because the bound was reached.

Parameters

condition

A lambda function that determines the condition to wait for. The function should return true when the condition is satisfied, and false otherwise.