330 |
|
sync.acquire(1); |
331 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
332 |
|
public void realRun() throws InterruptedException { |
333 |
< |
sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000L * 1000L); |
333 |
> |
sync.tryAcquireNanos(1, MILLISECONDS.toNanos(MEDIUM_DELAY_MS)); |
334 |
|
}}); |
335 |
|
|
336 |
|
t.start(); |
364 |
|
sync.acquire(1); |
365 |
|
Thread t = new Thread(new CheckedRunnable() { |
366 |
|
public void realRun() throws InterruptedException { |
367 |
< |
threadAssertFalse(sync.tryAcquireNanos(1, SHORT_DELAY_MS * 1000L * 1000L)); |
367 |
> |
long nanos = MILLISECONDS.toNanos(SHORT_DELAY_MS); |
368 |
> |
assertFalse(sync.tryAcquireNanos(1, nanos)); |
369 |
|
}}); |
370 |
|
|
371 |
|
t.start(); |
809 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
810 |
|
public void realRun() throws InterruptedException { |
811 |
|
sync.acquire(1); |
812 |
< |
c.awaitNanos(LONG_DELAY_MS * 1000L * 1000L); |
812 |
> |
c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS)); |
813 |
|
}}); |
814 |
|
|
815 |
|
t.start(); |
956 |
|
|
957 |
|
Thread t = new Thread(new CheckedRunnable() { |
958 |
|
public void realRun() throws InterruptedException { |
959 |
< |
threadAssertFalse(l.isSignalled()); |
960 |
< |
threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS * 1000L * 1000L)); |
961 |
< |
threadAssertTrue(l.isSignalled()); |
959 |
> |
assertFalse(l.isSignalled()); |
960 |
> |
long nanos = MILLISECONDS.toNanos(MEDIUM_DELAY_MS); |
961 |
> |
assertTrue(l.tryAcquireSharedNanos(0, nanos)); |
962 |
> |
assertTrue(l.isSignalled()); |
963 |
|
}}); |
964 |
|
|
965 |
|
t.start(); |
994 |
|
final BooleanLatch l = new BooleanLatch(); |
995 |
|
Thread t = new Thread(new CheckedInterruptedRunnable() { |
996 |
|
public void realRun() throws InterruptedException { |
997 |
< |
threadAssertFalse(l.isSignalled()); |
998 |
< |
l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L); |
997 |
> |
assertFalse(l.isSignalled()); |
998 |
> |
long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS); |
999 |
> |
l.tryAcquireSharedNanos(0, nanos); |
1000 |
|
}}); |
1001 |
|
|
1002 |
|
t.start(); |
1013 |
|
final BooleanLatch l = new BooleanLatch(); |
1014 |
|
Thread t = new Thread(new CheckedRunnable() { |
1015 |
|
public void realRun() throws InterruptedException { |
1016 |
< |
threadAssertFalse(l.isSignalled()); |
1017 |
< |
threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS * 1000L * 1000L)); |
1016 |
> |
assertFalse(l.isSignalled()); |
1017 |
> |
long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS); |
1018 |
> |
assertFalse(l.tryAcquireSharedNanos(0, nanos)); |
1019 |
|
}}); |
1020 |
|
|
1021 |
|
t.start(); |