ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/SynchronousQueueTest.java
(Generate patch)

Comparing jsr166/src/test/tck/SynchronousQueueTest.java (file contents):
Revision 1.63 by jsr166, Sun Aug 11 22:29:27 2019 UTC vs.
Revision 1.64 by jsr166, Tue Aug 13 00:54:51 2019 UTC

# Line 190 | Line 190 | public class SynchronousQueueTest extend
190       * timed offer times out if elements not taken
191       */
192      public void testTimedOffer() {
193 <        final boolean fair = ThreadLocalRandom.current().nextBoolean();
193 >        final boolean fair = randomBoolean();
194          final SynchronousQueue q = new SynchronousQueue(fair);
195          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
196          Thread t = newStartedThread(new CheckedRunnable() {
# Line 248 | Line 248 | public class SynchronousQueueTest extend
248       * timed poll with nonzero timeout times out if no active putter
249       */
250      public void testTimedPoll() {
251 <        final boolean fair = ThreadLocalRandom.current().nextBoolean();
251 >        final boolean fair = randomBoolean();
252          final SynchronousQueue q = new SynchronousQueue(fair);
253          final long startTime = System.nanoTime();
254          try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); }
# Line 261 | Line 261 | public class SynchronousQueueTest extend
261       * after offer succeeds; on interruption throws
262       */
263      public void testTimedPollWithOffer() {
264 <        final boolean fair = ThreadLocalRandom.current().nextBoolean();
264 >        final boolean fair = randomBoolean();
265          final SynchronousQueue q = new SynchronousQueue(fair);
266          final CountDownLatch pleaseOffer = new CountDownLatch(1);
267          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines