public final class Blocker extends Object
This class should be used when the condition has to be evaluated and a
notification is not possible; if it is possible to get a notification when
the condition may change Object.wait() and Object.notify()/
Object.notifyAll() should be used instead.
If the thread does not need to be blocked, but a condition change
notification is still not possible, use Waiter instead.
public static void wait(Predicate<Void> condition, javax.measure.Measurable<javax.measure.quantity.Duration> evaluationPeriod, Integer maxEvaluations) throws InterruptedException
true.condition - condition (or predicate) to evaluateevaluationPeriod - period between evaluations (time the thread will be in sleep mode
until a new evaluation is performed)maxEvaluations - maximum number of evaluations, null to evaluate until the
predicate or condition becomes trueInterruptedException - if any thread has interrupted the current thread.Copyright © 2014. All Rights Reserved.