< prev index next >
src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java
Print this page
@@ -26,14 +26,21 @@
package jdk.internal.misc;
public interface JavaLangRefAccess {
/**
- * Help ReferenceHandler thread process next pending
- * {@link java.lang.ref.Reference}
+ * Triggers discovery of new Reference(s) and returns the phase sequence number
+ * in which they were discovered or previous phase sequence number if no new
+ * Reference(s) were discovered.
+ */
+ int discoverReferences();
+
+ /**
+ * Blocks until all Reference(s) that were discovered in given
+ * {@code discoveryPhase} (as returned by {@link #discoverReferences()})
+ * have been enqueued.
*
- * @return {@code true} if there was a pending reference and it
- * was enqueue-ed or {@code false} if there was no
- * pending reference
+ * @param discoveryPhase the discovery phase sequence number.
+ * @throws InterruptedException if interrupted while waiting.
*/
- boolean tryHandlePendingReference();
+ void awaitReferencesEnqueued(int discoveryPhase) throws InterruptedException;
}
< prev index next >