Top Description Inners Fields Constructors Methods
java.lang.ref

pack-priv final Class NativeReferenceQueue<T>

extends ReferenceQueue<T>
Class Inheritance

An implementation of a ReferenceQueue that uses native monitors. The use of java.util.concurrent.lock locks interacts with various mechanisms, such as virtual threads and ForkJoinPool, that might not be appropriate for some low-level mechanisms, in particular MethodType's weak intern set.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final NativeReferenceQueue.Lock
Inherited from java.lang.ref.ReferenceQueue:
ENQUEUEDNULL

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
await(long timeoutMillis)

Overrides java.lang.ref.ReferenceQueue.await.

pack-priv boolean
public Reference<? extends T>
poll()

Overrides java.lang.ref.ReferenceQueue.poll.

Polls this queue to see if a reference object is available.

public Reference<? extends T>
remove(long
If positive, block for up to timeout milliseconds while waiting for a reference to be added to this queue. If zero, block indefinitely.
timeout
)

Overrides java.lang.ref.ReferenceQueue.remove.

Removes the next reference object in this queue, blocking until either one becomes available or the given timeout period expires.

public Reference<? extends T>
remove()

Overrides java.lang.ref.ReferenceQueue.remove.

Removes the next reference object in this queue, blocking until one becomes available.

pack-priv void
Inherited from java.lang.ref.ReferenceQueue:
enqueue0forEachheadIsNullpoll0remove0remove0

Field Detail

lockback to summary
private final NativeReferenceQueue.Lock lock

Hides java.lang.ref.ReferenceQueue.lock.

Constructor Detail

NativeReferenceQueueback to summary
public NativeReferenceQueue()

Method Detail

awaitback to summary
pack-priv void await() throws InterruptedException

Overrides java.lang.ref.ReferenceQueue.await.

Annotations
@Override
awaitback to summary
pack-priv void await(long timeoutMillis) throws InterruptedException

Overrides java.lang.ref.ReferenceQueue.await.

Annotations
@Override
enqueueback to summary
pack-priv boolean enqueue(Reference<? extends T> r)

Overrides java.lang.ref.ReferenceQueue.enqueue.

Annotations
@Override
pollback to summary
public Reference<? extends T> poll()

Overrides java.lang.ref.ReferenceQueue.poll.

Doc from java.lang.ref.ReferenceQueue.poll.

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 null.

Returns:Reference<? extends T>

A reference object, if one was immediately available, otherwise null

Annotations
@Override
removeback to summary
public Reference<? extends T> remove(long timeout) throws IllegalArgumentException, InterruptedException

Overrides java.lang.ref.ReferenceQueue.remove.

Doc from java.lang.ref.ReferenceQueue.remove.

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 Object#wait(long) method.

Parameters
timeout:long

If positive, block for up to timeout milliseconds while waiting for a reference to be added to this queue. If zero, block indefinitely.

Returns:Reference<? extends T>

A reference object, if one was available within the specified timeout period, otherwise null

Annotations
@Override
Exceptions
IllegalArgumentException:
If the value of the timeout argument is negative
InterruptedException:
If the timeout wait is interrupted
removeback to summary
public Reference<? extends T> remove() throws InterruptedException

Overrides java.lang.ref.ReferenceQueue.remove.

Doc from java.lang.ref.ReferenceQueue.remove.

Removes the next reference object in this queue, blocking until one becomes available.

Returns:Reference<? extends T>

A reference object, blocking until one becomes available

Annotations
@Override
Exceptions
InterruptedException:
If the wait is interrupted
signalback to summary
pack-priv void signal()

Overrides java.lang.ref.ReferenceQueue.signal.

Annotations
@Override
java.lang.ref back to summary

private Class NativeReferenceQueue.Lock

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
private
Lock()

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Lockback to summary
private Lock()