public class Locker
extends java.lang.Object
Convenience auto closeable ReentrantLock
wrapper.
try (Locker.Lock lock = locker.lock()) { // something }
Modifier and Type | Class and Description |
---|---|
class |
Locker.Lock
The unlocker object that unlocks when it is closed.
|
class |
Locker.UnLock
Deprecated.
|
Constructor and Description |
---|
Locker() |
Modifier and Type | Method and Description |
---|---|
boolean |
isLocked() |
Locker.Lock |
lock()
Acquires the lock.
|
Locker.Lock |
lockIfNotHeld()
Deprecated.
use
lock() instead |
java.util.concurrent.locks.Condition |
newCondition() |
public Locker.Lock lock()
Acquires the lock.
@Deprecated public Locker.Lock lockIfNotHeld()
lock()
insteadpublic boolean isLocked()
public java.util.concurrent.locks.Condition newCondition()
Condition
associated with this lockCopyright © 1995–2023 Webtide. All rights reserved.