Skip to content

Commit 117f0b4

Browse files
author
Kim Barrett
committed
8361426: (ref) Remove jdk.internal.ref.Cleaner
Reviewed-by: jpai, vklang
1 parent dedcce0 commit 117f0b4

File tree

3 files changed

+1
-233
lines changed

3 files changed

+1
-233
lines changed

src/java.base/share/classes/java/lang/ref/Reference.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525

2626
package java.lang.ref;
2727

28-
import jdk.internal.misc.Unsafe;
2928
import jdk.internal.vm.annotation.ForceInline;
3029
import jdk.internal.vm.annotation.IntrinsicCandidate;
3130
import jdk.internal.access.JavaLangRefAccess;
3231
import jdk.internal.access.SharedSecrets;
33-
import jdk.internal.ref.Cleaner;
3432

3533
/**
3634
* Abstract base class for reference objects. This class defines the
@@ -199,11 +197,6 @@ private static class ReferenceHandler extends Thread {
199197
}
200198

201199
public void run() {
202-
// pre-load and initialize Cleaner class so that we don't
203-
// get into trouble later in the run loop if there's
204-
// memory shortage while loading/initializing it lazily.
205-
Unsafe.getUnsafe().ensureClassInitialized(Cleaner.class);
206-
207200
while (true) {
208201
processPendingReferences();
209202
}
@@ -253,18 +246,7 @@ private static void processPendingReferences() {
253246
Reference<?> ref = pendingList;
254247
pendingList = ref.discovered;
255248
ref.discovered = null;
256-
257-
if (ref instanceof Cleaner) {
258-
((Cleaner)ref).clean();
259-
// Notify any waiters that progress has been made.
260-
// This improves latency for nio.Bits waiters, which
261-
// are the only important ones.
262-
synchronized (processPendingLock) {
263-
processPendingLock.notifyAll();
264-
}
265-
} else {
266-
ref.enqueueFromPending();
267-
}
249+
ref.enqueueFromPending();
268250
}
269251
// Notify any waiters of completion of current round.
270252
synchronized (processPendingLock) {

src/java.base/share/classes/jdk/internal/ref/Cleaner.java

Lines changed: 0 additions & 150 deletions
This file was deleted.

test/jdk/jdk/internal/ref/Cleaner/ExitOnThrow.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)