class SingleLock extends java.lang.Object implements ResourceLock
Modifier and Type | Class and Description |
---|---|
private class |
SingleLock.SingleLockManagedBlocker |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.locks.Lock |
lock |
Constructor and Description |
---|
SingleLock(java.util.concurrent.locks.Lock lock) |
Modifier and Type | Method and Description |
---|---|
ResourceLock |
acquire()
Acquire this resource lock, potentially blocking.
|
(package private) java.util.concurrent.locks.Lock |
getLock() |
void |
release()
Release this resource lock.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
java.util.concurrent.locks.Lock getLock()
public ResourceLock acquire() throws java.lang.InterruptedException
ResourceLock
acquire
in interface ResourceLock
java.lang.InterruptedException
- if the calling thread is interrupted
while waiting to acquire this lockpublic void release()
ResourceLock
release
in interface ResourceLock