Memory consistency effects:
The enqueueing of a reference to a queue (by the garbage collector, or by a
successful call to Reference#enqueue
)
happens-before
the reference is removed from the queue by ReferenceQueue#poll
or
ReferenceQueue#remove
.
Modifier and Type | Class and Description |
---|---|
private static class | |
private static class |
Modifier and Type | Field and Description |
---|---|
pack-priv static final ReferenceQueue | |
private volatile Reference | |
private final ReferenceQueue. | |
pack-priv static final ReferenceQueue | |
private long |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
private void | |
pack-priv boolean | |
private boolean | |
pack-priv void | |
public Reference | Returns: A reference object, if one was immediately available, otherwisenull Polls this queue to see if a reference object is available. |
private Reference | |
public Reference | Returns: A reference object, if one was available within the specified timeout period, otherwisenull If positive, block for up to timeout)timeout
milliseconds while waiting for a reference to be
added to this queue. If zero, block indefinitely.Removes the next reference object in this queue, blocking until either one becomes available or the given timeout period expires. |
public Reference | Returns: A reference object, blocking until one becomes availableRemoves the next reference object in this queue, blocking until one becomes available. |
private Reference | |
private Reference | |
private boolean |
ENQUEUED | back to summary |
---|---|
pack-priv static final ReferenceQueue<Object> ENQUEUED |
head | back to summary |
---|---|
private volatile Reference<? extends T> head |
lock | back to summary |
---|---|
private final ReferenceQueue. |
NULL | back to summary |
---|---|
pack-priv static final ReferenceQueue<Object> NULL |
queueLength | back to summary |
---|---|
private long queueLength |
ReferenceQueue | back to summary |
---|---|
public ReferenceQueue() Constructs a new reference-object queue. |
enablePreempt | back to summary |
---|---|
private void enablePreempt() |
enqueue | back to summary |
---|---|
pack-priv boolean enqueue(Reference<? extends T> r) |
enqueue0 | back to summary |
---|---|
private boolean enqueue0(Reference<? extends T> r) |
forEach | back to summary |
---|---|
pack-priv void forEach(Consumer<? super Reference<? extends T>> action) Iterate queue and invoke given action with each Reference. Suitable for diagnostic purposes. Warning any use of this method should make sure to not retain the referents of iterated references (in case of FinalReference(s)) so that their life is not prolonged more than necessary. |
poll | back to summary |
---|---|
public Reference Polls this queue to see if a reference object is available. If one is
available without further delay then it is removed from the queue and
returned. Otherwise this method immediately returns
|
poll0 | back to summary |
---|---|
private Reference |
remove | back to summary |
---|---|
public Reference Removes the next reference object in this queue, blocking until either one becomes available or the given timeout period expires. This method does not offer real-time guarantees: It schedules the
timeout as if by invoking the
|
remove | back to summary |
---|---|
public Reference Removes the next reference object in this queue, blocking until one becomes available.
|
remove0 | back to summary |
---|---|
private Reference |
remove0 | back to summary |
---|---|
private Reference |
tryDisablePreempt | back to summary |
---|---|
private boolean tryDisablePreempt() |
Access | Constructor and Description |
---|---|
private |
Lock | back to summary |
---|---|
private Lock() |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
pack-priv boolean |
Null | back to summary |
---|---|
private Null() |
enqueue | back to summary |
---|---|
pack-priv boolean enqueue(Reference<?> r) Overrides java.
|