608 |
|
Thread t2 = newStartedThread(new CheckedRunnable() { |
609 |
|
public void realRun() throws InterruptedException { |
610 |
|
// Will fail, even though 1 permit is available |
611 |
< |
assertFalse(s.tryAcquire(0L, MILLISECONDS)); |
612 |
< |
assertFalse(s.tryAcquire(1, 0L, MILLISECONDS)); |
611 |
> |
assertFalse( |
612 |
> |
s.tryAcquire(randomExpiredTimeout(), randomTimeUnit())); |
613 |
> |
assertFalse( |
614 |
> |
s.tryAcquire(1, randomExpiredTimeout(), randomTimeUnit())); |
615 |
|
|
616 |
|
// untimed tryAcquire will barge and succeed |
617 |
|
assertTrue(s.tryAcquire()); |