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

Reviewed-by: mchung, alanb
This commit is contained in:
Viktor Klang 2024-04-04 18:32:59 +00:00
parent 4276d5c004
commit 28216aa971
2 changed files with 9 additions and 6 deletions

View file

@ -1140,12 +1140,7 @@ public class ForkJoinPool extends AbstractExecutorService {
boolean isCommon = (pool.workerNamePrefix == null);
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm == null) {
if (isCommon)
return new ForkJoinWorkerThread.InnocuousForkJoinWorkerThread(pool);
else
return new ForkJoinWorkerThread(null, pool, true, false);
} else if (isCommon)
if (sm != null && isCommon)
return newCommonWithACC(pool);
else
return newRegularWithACC(pool);