类 SmartLock.WithCondition
java.lang.Object
cn.taketoday.util.concurrent.SmartLock
cn.taketoday.util.concurrent.SmartLock.WithCondition
- 所有已实现的接口:
Serializable,AutoCloseable
- 封闭类:
- SmartLock
A reentrant lock with a condition that can be used in a try-with-resources statement.
Typical usage:
// Waiting
try (SmartLock lock = lock.lock())
{
lock.await();
}
// Signaling
try (SmartLock lock = lock.lock())
{
lock.signalAll();
}
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.util.concurrent.SmartLock
SmartLock.WithCondition -
字段概要
字段 -
构造器概要
构造器 -
方法概要
从类继承的方法 cn.taketoday.util.concurrent.SmartLock
close, forCondition, forCondition, forCondition, isHeldByCurrentThread, isLocked, newCondition, of, of, of
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
condition
-
-
构造器详细资料
-
WithCondition
-
-
方法详细资料
-
lock
从类复制的说明:SmartLockAcquires the lock.
-
signal
public void signal()- 另请参阅:
-
signalAll
public void signalAll()- 另请参阅:
-
await
- 抛出:
InterruptedException- if the current thread is interrupted- 另请参阅:
-
await
- 参数:
time- the time to waitunit- the time unit- 返回:
- false if the waiting time elapsed
- 抛出:
InterruptedException- if the current thread is interrupted- 另请参阅:
-