public class AutoCloseableLock extends Object implements AutoCloseable, Lock
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static AutoCloseableLock |
createFor(Lock lock) |
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
boolean |
tryLock() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
public static AutoCloseableLock createFor(Lock lock)
public void close()
close in interface AutoCloseablepublic void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic boolean tryLock(long time,
TimeUnit unit)
throws InterruptedException
tryLock in interface LockInterruptedExceptionpublic Condition newCondition()
newCondition in interface Lock