public class AutoLock extends Object implements Closeable, Serializable
Reentrant lock that can be used in a try-with-resources statement.
Typical usage:
try (AutoLock lock = this.lock.lock())
{
// Something
}
| 限定符和类型 | 类和说明 |
|---|---|
static class |
AutoLock.WithCondition
A reentrant lock with a condition that can be used in a try-with-resources statement.
|
| 构造器和说明 |
|---|
AutoLock() |
public AutoLock lock()
Acquires the lock.
public boolean isHeldByCurrentThread()
ReentrantLock.isHeldByCurrentThread()public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2022. All rights reserved.