awaitUntil

open suspend override fun awaitUntil(deadline: Instant): Boolean

Implements absolute timed condition wait.

  1. If current thread is interrupted, throw InterruptedException.

  2. Save lock state returned by .getState.

  3. Invoke .release with saved state as argument, throwing IllegalMonitorStateException if it fails.

  4. Block until signalled, interrupted, or timed out.

  5. Reacquire by invoking specialized version of .acquire with saved state as argument.

  6. If interrupted while blocked in step 4, throw InterruptedException.

  7. If timed out while blocked in step 4, return false, else true.