49 |
|
|
50 |
|
|
51 |
|
/** |
52 |
< |
* A runnable calling acquire that expects to be |
53 |
< |
* interrupted |
52 |
> |
* A runnable calling acquire that expects to be interrupted |
53 |
|
*/ |
54 |
|
class InterruptedLockRunnable extends CheckedInterruptedRunnable { |
55 |
|
final Semaphore lock; |
618 |
|
final Semaphore s = new Semaphore(2, true); |
619 |
|
Thread t = new Thread(new CheckedRunnable() { |
620 |
|
public void realRun() throws InterruptedException { |
621 |
< |
threadAssertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS)); |
621 |
> |
assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS)); |
622 |
|
s.release(2); |
623 |
< |
threadAssertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS)); |
623 |
> |
assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS)); |
624 |
|
s.release(2); |
625 |
|
}}); |
626 |
|
|