Skip to content

Commit 53c4714

Browse files
author
Viktor Klang
committed
8327501: Common ForkJoinPool prevents class unloading in some cases
Reviewed-by: alanb
1 parent 1261740 commit 53c4714

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,12 @@ public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
11401140
boolean isCommon = (pool.workerNamePrefix == null);
11411141
@SuppressWarnings("removal")
11421142
SecurityManager sm = System.getSecurityManager();
1143-
if (sm == null)
1144-
return new ForkJoinWorkerThread(null, pool, true, false);
1145-
else if (isCommon)
1143+
if (sm == null) {
1144+
if (isCommon)
1145+
return new ForkJoinWorkerThread.InnocuousForkJoinWorkerThread(pool);
1146+
else
1147+
return new ForkJoinWorkerThread(null, pool, true, false);
1148+
} else if (isCommon)
11461149
return newCommonWithACC(pool);
11471150
else
11481151
return newRegularWithACC(pool);

0 commit comments

Comments
 (0)