RFR: 8328366: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501

Viktor Klang vklang at openjdk.org
Wed Mar 20 20:08:21 UTC 2024


On Wed, 20 Mar 2024 17:15:49 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> This is a draft PR with a potential solution to 8328366 without regressing 8327501.
>> 
>> @DougLea To avoid regressions in the future, where would regression tests for this ideally be located?
>
> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1143:
> 
>> 1141:             @SuppressWarnings("removal")
>> 1142:             SecurityManager sm = System.getSecurityManager();
>> 1143:             if (sm != null && isCommon)
> 
> For common thread pool, if SM is not enabled, it will create `ForkJoinWorkerThread` that does not clear thread locals which is different than JDK 18 behavior.  Is this intentional?

@mlchung Yeah, @DougLea perhaps want to weigh in on that. I wonder if this should be addressed as this PR or if it should be handled separately?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18374#discussion_r1532781080


More information about the core-libs-dev mailing list