Class AutoLock

java.lang.Object
org.eclipse.jetty.util.thread.AutoLock
All Implemented Interfaces:
Serializable, AutoCloseable
Direct Known Subclasses:
AutoLock.WithCondition

public class AutoLock extends Object implements AutoCloseable, Serializable

Reentrant lock that can be used in a try-with-resources statement.

Typical usage:

try (AutoLock lock = this.lock.lock())
{
    // Something
}
See Also: