--- jsr166/src/test/loops/ContextSwitchTest.java 2015/08/10 03:13:33 1.8 +++ jsr166/src/test/loops/ContextSwitchTest.java 2015/10/12 20:16:47 1.9 @@ -37,6 +37,13 @@ public final class ContextSwitchTest { } static final class MyThread extends Thread { + + static { + // Reduce the risk of rare disastrous classloading in first call to + // LockSupport.park: https://bugs.openjdk.java.net/browse/JDK-8074773 + Class ensureLoaded = LockSupport.class; + } + volatile Thread other; volatile int nparks;