< 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}
+ * Blocks until all Reference(s) that were pending at the time this method
+ * was called have been enqueued.
+ *
+ * @throws InterruptedException if the thread is interrupted while waiting.
+ */
+ void awaitPendingReferencesEnqueued() 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 >