Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146038

CleanerImpl should not depend on ManagedLocalsThread

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Resolved In Build:
      b100

      Description

      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() ||

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                chegar Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: