Class AutoLock.WithCondition

java.lang.Object
org.eclipse.jetty.util.thread.AutoLock
org.eclipse.jetty.util.thread.AutoLock.WithCondition
All Implemented Interfaces:
Serializable, AutoCloseable
Enclosing class:
AutoLock

public static class AutoLock.WithCondition extends AutoLock

A reentrant lock with a condition that can be used in a try-with-resources statement.

Typical usage:

 // Waiting
 try (AutoLock lock = _lock.lock())
 {
     lock.await();
 }

 // Signaling
 try (AutoLock lock = _lock.lock())
 {
     lock.signalAll();
 }
 
See Also: