Skip to content

8361426: (ref) Remove jdk.internal.ref.Cleaner #26141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions src/java.base/share/classes/java/lang/ref/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@

package java.lang.ref;

import jdk.internal.misc.Unsafe;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.access.JavaLangRefAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.ref.Cleaner;

/**
* Abstract base class for reference objects. This class defines the
Expand Down Expand Up @@ -199,11 +197,6 @@ private static class ReferenceHandler extends Thread {
}

public void run() {
// pre-load and initialize Cleaner class so that we don't
// get into trouble later in the run loop if there's
// memory shortage while loading/initializing it lazily.
Unsafe.getUnsafe().ensureClassInitialized(Cleaner.class);

while (true) {
processPendingReferences();
}
Expand Down Expand Up @@ -253,18 +246,7 @@ private static void processPendingReferences() {
Reference<?> ref = pendingList;
pendingList = ref.discovered;
ref.discovered = null;

if (ref instanceof Cleaner) {
((Cleaner)ref).clean();
// Notify any waiters that progress has been made.
// This improves latency for nio.Bits waiters, which
// are the only important ones.
synchronized (processPendingLock) {
processPendingLock.notifyAll();
}
} else {
ref.enqueueFromPending();
}
ref.enqueueFromPending();
}
// Notify any waiters of completion of current round.
synchronized (processPendingLock) {
Expand Down
150 changes: 0 additions & 150 deletions src/java.base/share/classes/jdk/internal/ref/Cleaner.java

This file was deleted.

64 changes: 0 additions & 64 deletions test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java

This file was deleted.