< 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}
+     * Triggers discovery of new Reference(s) and blocks until they have been
+     * enqueued into their respective queues.
+     *
+     * @throws InterruptedException if interrupted while waiting.
+     */
+    void discoverAndEnqueueReferences() throws InterruptedException;
+
+    /**
+     * 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 >