public final class SuspendableRefContainer
extends java.lang.Object
Constructor and Description |
---|
SuspendableRefContainer() |
Modifier and Type | Method and Description |
---|---|
Releasable |
acquire()
Acquires a reference.
|
Releasable |
acquireUninterruptibly()
Acquires a reference.
|
int |
activeRefs()
Returns the number of references currently being held.
|
Releasable |
blockAcquisition()
Disables reference acquisition and waits until all existing references are released.
|
Releasable |
tryAcquire()
Tries acquiring a reference.
|
public Releasable tryAcquire() throws java.lang.InterruptedException
blockAcquisition()
). Returns null if reference acquisition is blocked at the time of invocation.java.lang.InterruptedException
- if the current thread is interruptedpublic Releasable acquire() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the current thread is interruptedpublic Releasable acquireUninterruptibly()
public Releasable blockAcquisition()
public int activeRefs()