I created a condition variable from reentrant lock with fair parameter set to true. There are multiple waiting threads on the condition variable in my application. I've read in documentation that if I call the signal method, the longest waiting thread will be signaled first. I want to know if the condition is not true for awakned thread and he call await again, will its waiting time reset or continue to accumuluate.
private ReentrantLock lock = new ReentrantLock(true);
private Condition condition = lock.newCondition();
lock.lock();
while (!isAllowedToProceed){
condition.await();
}
lock.unlock();
The waiting time is the time the thread is currently waiting. It does not include any previous waits. You can think of it as a FIFO queue.