--- jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2018/06/13 18:36:31 1.64 +++ jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2019/08/13 03:39:46 1.67 @@ -1283,7 +1283,7 @@ public class AbstractQueuedSynchronizerT try { s.acquireInterruptibly(1); shouldThrow(); - } catch (InterruptedException expected) {} + } catch (InterruptedException success) {} }; for (int i = 0; i < 2; i++) { Thread thread = new Thread(failedAcquire); @@ -1316,7 +1316,7 @@ public class AbstractQueuedSynchronizerT // A synchronizer only offering a choice of failure modes class Sync extends AbstractQueuedSynchronizer { - boolean pleaseThrow; + volatile boolean pleaseThrow; @Override protected boolean tryAcquire(int ignored) { if (pleaseThrow) throw ex; return false; @@ -1338,7 +1338,7 @@ public class AbstractQueuedSynchronizerT final Thread thread = newStartedThread(new CheckedRunnable() { public void realRun() { try { - if (ThreadLocalRandom.current().nextBoolean()) + if (randomBoolean()) s.acquire(1); else s.acquireShared(1);