120 |
|
s.acquire(); |
121 |
|
s.release(); |
122 |
|
assertEquals(1, s.availablePermits()); |
123 |
< |
} catch ( InterruptedException e) { |
123 |
> |
} catch (InterruptedException e) { |
124 |
|
unexpectedException(); |
125 |
|
} |
126 |
|
} |
165 |
|
assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
166 |
|
s.release(); |
167 |
|
assertEquals(1, s.availablePermits()); |
168 |
< |
} catch ( InterruptedException e) { |
168 |
> |
} catch (InterruptedException e) { |
169 |
|
unexpectedException(); |
170 |
|
} |
171 |
|
} |
196 |
|
s.acquire(); |
197 |
|
s.release(); |
198 |
|
t.join(); |
199 |
< |
} catch ( InterruptedException e) { |
199 |
> |
} catch (InterruptedException e) { |
200 |
|
unexpectedException(); |
201 |
|
} |
202 |
|
} |
223 |
|
s.acquireUninterruptibly(); |
224 |
|
s.release(); |
225 |
|
t.join(); |
226 |
< |
} catch ( InterruptedException e) { |
226 |
> |
} catch (InterruptedException e) { |
227 |
|
unexpectedException(); |
228 |
|
} |
229 |
|
} |
255 |
|
s.release(); |
256 |
|
s.release(); |
257 |
|
t.join(); |
258 |
< |
} catch ( InterruptedException e) { |
258 |
> |
} catch (InterruptedException e) { |
259 |
|
unexpectedException(); |
260 |
|
} |
261 |
|
} |
524 |
|
s.release(5); |
525 |
|
s.acquire(5); |
526 |
|
assertEquals(1, s.availablePermits()); |
527 |
< |
} catch ( InterruptedException e) { |
527 |
> |
} catch (InterruptedException e) { |
528 |
|
unexpectedException(); |
529 |
|
} |
530 |
|
} |
567 |
|
s.release(5); |
568 |
|
assertTrue(s.tryAcquire(5, SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
569 |
|
assertEquals(1, s.availablePermits()); |
570 |
< |
} catch ( InterruptedException e) { |
570 |
> |
} catch (InterruptedException e) { |
571 |
|
unexpectedException(); |
572 |
|
} |
573 |
|
} |
589 |
|
assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
590 |
|
s.release(); |
591 |
|
assertEquals(1, s.availablePermits()); |
592 |
< |
} catch ( InterruptedException e) { |
592 |
> |
} catch (InterruptedException e) { |
593 |
|
unexpectedException(); |
594 |
|
} |
595 |
|
} |
622 |
|
s.release(); |
623 |
|
t.join(); |
624 |
|
assertEquals(2, s.availablePermits()); |
625 |
< |
} catch ( InterruptedException e) { |
625 |
> |
} catch (InterruptedException e) { |
626 |
|
unexpectedException(); |
627 |
|
} |
628 |
|
} |
650 |
|
s.acquire(2); |
651 |
|
s.release(1); |
652 |
|
t.join(); |
653 |
< |
} catch ( InterruptedException e) { |
653 |
> |
} catch (InterruptedException e) { |
654 |
|
unexpectedException(); |
655 |
|
} |
656 |
|
} |
679 |
|
s.acquire(2); |
680 |
|
s.release(2); |
681 |
|
t.join(); |
682 |
< |
} catch ( InterruptedException e) { |
682 |
> |
} catch (InterruptedException e) { |
683 |
|
unexpectedException(); |
684 |
|
} |
685 |
|
} |
715 |
|
s.release(); |
716 |
|
s.release(); |
717 |
|
t.join(); |
718 |
< |
} catch ( InterruptedException e) { |
718 |
> |
} catch (InterruptedException e) { |
719 |
|
unexpectedException(); |
720 |
|
} |
721 |
|
} |
744 |
|
assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, TimeUnit.MILLISECONDS)); |
745 |
|
s.release(2); |
746 |
|
t.join(); |
747 |
< |
} catch ( InterruptedException e) { |
747 |
> |
} catch (InterruptedException e) { |
748 |
|
unexpectedException(); |
749 |
|
} |
750 |
|
} |