Relates :
|
|
Relates :
|
With the addition of a Thread constructor that can suppress the inheriting of inheritable thread-local variable initial values from the constructing thread JDK-8056152, the usages of ManagedLocalsThread were removed from the base module. ManagedLocalsThread was also removed from the hierarchy of InnocuousThread, to help reduce dependencies. As a result InnocuousThread is no longer a ManagedLocalsThread, and the CleanerImpl should not use it in its instance of check. diff --git a/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java b/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java --- a/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java +++ b/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java @@ -39,7 +39,6 @@ import java.util.function.Function; import sun.misc.InnocuousThread; -import sun.misc.ManagedLocalsThread; /** * CleanerImpl manages a set of object references and corresponding cleaning actions. @@ -130,8 +129,8 @@ */ public void run() { Thread t = Thread.currentThread(); - ManagedLocalsThread mlThread = (t instanceof ManagedLocalsThread) - ? (ManagedLocalsThread) t + InnocuousThread mlThread = (t instanceof InnocuousThread) + ? (InnocuousThread) t : null; while (!phantomCleanableList.isListEmpty() || !weakCleanableList.isListEmpty() ||