-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b100
With the addition of a Thread constructor that can suppress the inheriting
of inheritable thread-local variable initial values from the constructing
threadJDK-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() ||
of inheritable thread-local variable initial values from the constructing
thread
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() ||
- relates to
-
JDK-8138696 java.lang.ref.Cleaner - an alternative to finalization
-
- Resolved
-
-
JDK-8056152 (thread) API to create Threads that do not inherit inheritable thread-local initial values
-
- Resolved
-