public class Locker
extends java.lang.Object
Convenience auto closeable ReentrantLock wrapper.
try (Locker.Lock lock = locker.lock())
{
// something
}
| Modifier and Type | Class | Description |
|---|---|---|
class |
Locker.Lock |
The unlocker object that unlocks when it is closed.
|
class |
Locker.UnLock |
Deprecated.
|
| Constructor | Description |
|---|---|
Locker() |
| Modifier and Type | Method | 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–2017 Webtide. All rights reserved.