8327501: Common ForkJoinPool prevents class unloading in some cases

Reviewed-by: alanb
This commit is contained in:
Viktor Klang 2024-03-07 09:44:35 +00:00
parent 1261740521
commit 53c4714aab

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