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

Comparing jsr166/src/test/tck/SemaphoreTest.java (file contents):
Revision 1.39 by jsr166, Sun May 14 03:31:53 2017 UTC vs.
Revision 1.40 by jsr166, Sun May 14 03:48:35 2017 UTC

# Line 195 | Line 195 | public class SemaphoreTest extends JSR16
195       * timed tryAcquire times out
196       */
197      public void testTryAcquire_timeout() {
198 <        final ThreadLocalRandom rnd = ThreadLocalRandom.current();
199 <        final boolean fair = rnd.nextBoolean();
198 >        final boolean fair = ThreadLocalRandom.current().nextBoolean();
199          final Semaphore s = new Semaphore(0, fair);
200          final long startTime = System.nanoTime();
201          try { assertFalse(s.tryAcquire(timeoutMillis(), MILLISECONDS)); }
# Line 208 | Line 207 | public class SemaphoreTest extends JSR16
207       * timed tryAcquire(N) times out
208       */
209      public void testTryAcquireN_timeout() {
210 <        final ThreadLocalRandom rnd = ThreadLocalRandom.current();
212 <        final boolean fair = rnd.nextBoolean();
210 >        final boolean fair = ThreadLocalRandom.current().nextBoolean();
211          final Semaphore s = new Semaphore(2, fair);
212          final long startTime = System.nanoTime();
213          try { assertFalse(s.tryAcquire(3, timeoutMillis(), MILLISECONDS)); }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines