public final class FeebleReferenceList<T> extends Object
Modifier and Type | Method and Description |
---|---|
protected static void |
clean(FeebleReference<?> fr)
Clean the list state that is kept in a FeebleReference.
|
static <T> FeebleReferenceList<T> |
factory()
A factory.
|
static void |
interruptWaiters() |
boolean |
isEmpty()
Whether the list is empty at the time of the call.
|
FeebleReference<? extends T> |
pop()
Pop a FeebleReference off of this list.
|
boolean |
push(FeebleReference<?> fr)
Push FeebleReference on to this list if it is not already on a list.
|
FeebleReference<? extends T> |
remove() |
FeebleReference<? extends T> |
remove(long timeoutMillis)
Removes the next reference object in this queue, blocking until either one becomes available
or the given timeout period expires.
|
static void |
signalWaiters() |
public static <T> FeebleReferenceList<T> factory()
public boolean isEmpty()
public boolean push(FeebleReference<?> fr)
The race to enqueue a reference is resolved by having only the thread that can clear the list slot enqueue the reference on the queue.
The race to enqueue other references on the same queue is resolved by the compare-and-set of the sampled head.
public FeebleReference<? extends T> pop()
public FeebleReference<? extends T> remove(long timeoutMillis) throws IllegalArgumentException, InterruptedException
public FeebleReference<? extends T> remove() throws InterruptedException
InterruptedException
public static void interruptWaiters()
public static void signalWaiters()
protected static void clean(FeebleReference<?> fr)