public class SingleLock
extends java.lang.Object
implements java.util.concurrent.locks.Lock
Constructor and Description |
---|
SingleLock(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
lock() |
void |
lockInterruptibly() |
java.util.concurrent.locks.Condition |
newCondition() |
java.lang.String |
toString() |
boolean |
tryLock() |
boolean |
tryLock(long time,
java.util.concurrent.TimeUnit unit) |
void |
unlock() |
public void lock()
lock
in interface java.util.concurrent.locks.Lock
public void lockInterruptibly() throws java.lang.InterruptedException
lockInterruptibly
in interface java.util.concurrent.locks.Lock
java.lang.InterruptedException
public boolean tryLock()
tryLock
in interface java.util.concurrent.locks.Lock
public boolean tryLock(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
tryLock
in interface java.util.concurrent.locks.Lock
java.lang.InterruptedException
public void unlock()
unlock
in interface java.util.concurrent.locks.Lock
public java.util.concurrent.locks.Condition newCondition()
newCondition
in interface java.util.concurrent.locks.Lock
public java.lang.String toString()
toString
in class java.lang.Object