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 AutoCloseable
public void lockInterruptibly() throws InterruptedException
lockInterruptibly
in interface Lock
InterruptedException
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException
tryLock
in interface Lock
InterruptedException
public Condition newCondition()
newCondition
in interface Lock