--- old/src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java 2016-03-28 16:44:46.949072339 +0200 +++ new/src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java 2016-03-28 16:44:46.863073827 +0200 @@ -28,12 +28,19 @@ 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; }