public class Locker extends 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 |
Condition |
newCondition() |
public Locker.Lock lock()
Acquires the lock.
@Deprecated public Locker.Lock lockIfNotHeld()
lock() insteadpublic boolean isLocked()
Copyright © 1995–2018 Webtide. All rights reserved.