< prev index next >
src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java
Print this page
@@ -23,17 +23,26 @@
* questions.
*/
package jdk.internal.misc;
+import java.lang.ref.Cleaner;
+
public interface JavaLangRefAccess {
/**
- * Help ReferenceHandler thread process next pending
- * {@link java.lang.ref.Reference}
+ * Enqueue pending {@link java.lang.ref.Reference}s if GC has discovered any.<p>
+ * This method does not return until all references that had been discovered
+ * by the time this method was called, are enqueued even if some of them are
+ * being enqueued concurrently by other threads.
+ */
+ void enqueuePendingReferences();
+
+ /**
+ * Processes next Cleanable that has been waiting in the queue maintained
+ * by given {@code cleaner}.
*
- * @return {@code true} if there was a pending reference and it
- * was enqueue-ed or {@code false} if there was no
- * pending reference
+ * @return {@code true} if a Cleanable was found in the queue and
+ * was processed or {@code false} if the queue was empty.
*/
- boolean tryHandlePendingReference();
+ boolean cleanNextEnqueuedCleanable(Cleaner cleaner);
}
< prev index next >