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

ForkJoinPool.commonPool() does not reset Thread Locals

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 19
    • core-libs
    • None

      With the ForkJoin updates for Java 19, the common pool stopped clearing thread locals.

      If someone relies on this behavior, then it is a semantic change as code which does not manage their TLs properly will be able to observe unexpected values, and values will be retained for longer than expected.

      Java 18: https://github.com/openjdk/jdk/blob/jdk-18%2B37/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java#L841
      Java 19: https://github.com/openjdk/jdk/blob/jdk-19%2B36/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java#L984

            dl Doug Lea
            vklang Viktor Klang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: