Skip to content

Commit dfcd8d2

Browse files
committed
8341989: [21u] Back out JDK-8327501 and JDK-8328366
Reviewed-by: goetz
1 parent 0083bcd commit dfcd8d2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,9 @@ public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
981981
boolean isCommon = (pool.workerNamePrefix == null);
982982
@SuppressWarnings("removal")
983983
SecurityManager sm = System.getSecurityManager();
984-
if (sm != null && isCommon)
984+
if (sm == null)
985+
return new ForkJoinWorkerThread(null, pool, true, false);
986+
else if (isCommon)
985987
return newCommonWithACC(pool);
986988
else
987989
return newRegularWithACC(pool);

test/jdk/java/util/concurrent/tck/ForkJoinPool9Test.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ public void testCommonPoolThreadContextClassLoader() throws Throwable {
7979
assertSame(ForkJoinPool.commonPool(), ForkJoinTask.getPool());
8080
Thread currentThread = Thread.currentThread();
8181

82-
ClassLoader preexistingContextClassLoader =
83-
currentThread.getContextClassLoader();
84-
8582
Stream.of(systemClassLoader, null).forEach(cl -> {
8683
if (randomBoolean())
8784
// should always be permitted, without effect
@@ -98,11 +95,6 @@ public void testCommonPoolThreadContextClassLoader() throws Throwable {
9895
() -> System.getProperty("foo"),
9996
() -> currentThread.setContextClassLoader(
10097
classLoaderDistinctFromSystemClassLoader));
101-
else {
102-
currentThread.setContextClassLoader(classLoaderDistinctFromSystemClassLoader);
103-
assertSame(currentThread.getContextClassLoader(), classLoaderDistinctFromSystemClassLoader);
104-
currentThread.setContextClassLoader(preexistingContextClassLoader);
105-
}
10698
// TODO ?
10799
// if (haveSecurityManager
108100
// && Thread.currentThread().getClass().getSimpleName()

0 commit comments

Comments
 (0)