282 |
|
lock.lock(); |
283 |
|
Thread t = new Thread(new CheckedRunnable() { |
284 |
|
public void realRun() { |
285 |
< |
threadAssertFalse(lock.tryLock()); |
285 |
> |
assertFalse(lock.tryLock()); |
286 |
|
}}); |
287 |
|
|
288 |
|
t.start(); |
298 |
|
lock.lock(); |
299 |
|
Thread t = new Thread(new CheckedRunnable() { |
300 |
|
public void realRun() throws InterruptedException { |
301 |
< |
threadAssertFalse(lock.tryLock(1, MILLISECONDS)); |
301 |
> |
assertFalse(lock.tryLock(1, MILLISECONDS)); |
302 |
|
}}); |
303 |
|
|
304 |
|
t.start(); |
579 |
|
Thread t = new Thread(new CheckedRunnable() { |
580 |
|
public void realRun() throws InterruptedException { |
581 |
|
lock.lock(); |
582 |
< |
threadAssertFalse(lock.hasWaiters(c)); |
583 |
< |
threadAssertEquals(0, lock.getWaitQueueLength(c)); |
582 |
> |
assertFalse(lock.hasWaiters(c)); |
583 |
> |
assertEquals(0, lock.getWaitQueueLength(c)); |
584 |
|
c.await(); |
585 |
|
lock.unlock(); |
586 |
|
}}); |
610 |
|
Thread t1 = new Thread(new CheckedRunnable() { |
611 |
|
public void realRun() throws InterruptedException { |
612 |
|
lock.lock(); |
613 |
< |
threadAssertFalse(lock.hasWaiters(c)); |
614 |
< |
threadAssertEquals(0, lock.getWaitQueueLength(c)); |
613 |
> |
assertFalse(lock.hasWaiters(c)); |
614 |
> |
assertEquals(0, lock.getWaitQueueLength(c)); |
615 |
|
c.await(); |
616 |
|
lock.unlock(); |
617 |
|
}}); |
619 |
|
Thread t2 = new Thread(new CheckedRunnable() { |
620 |
|
public void realRun() throws InterruptedException { |
621 |
|
lock.lock(); |
622 |
< |
threadAssertTrue(lock.hasWaiters(c)); |
623 |
< |
threadAssertEquals(1, lock.getWaitQueueLength(c)); |
622 |
> |
assertTrue(lock.hasWaiters(c)); |
623 |
> |
assertEquals(1, lock.getWaitQueueLength(c)); |
624 |
|
c.await(); |
625 |
|
lock.unlock(); |
626 |
|
}}); |
654 |
|
Thread t1 = new Thread(new CheckedRunnable() { |
655 |
|
public void realRun() throws InterruptedException { |
656 |
|
lock.lock(); |
657 |
< |
threadAssertTrue(lock.getWaitingThreads(c).isEmpty()); |
657 |
> |
assertTrue(lock.getWaitingThreads(c).isEmpty()); |
658 |
|
c.await(); |
659 |
|
lock.unlock(); |
660 |
|
}}); |
662 |
|
Thread t2 = new Thread(new CheckedRunnable() { |
663 |
|
public void realRun() throws InterruptedException { |
664 |
|
lock.lock(); |
665 |
< |
threadAssertFalse(lock.getWaitingThreads(c).isEmpty()); |
665 |
> |
assertFalse(lock.getWaitingThreads(c).isEmpty()); |
666 |
|
c.await(); |
667 |
|
lock.unlock(); |
668 |
|
}}); |
845 |
|
Thread t1 = new Thread(new CheckedRunnable() { |
846 |
|
public void realRun() throws InterruptedException { |
847 |
|
lock.lock(); |
848 |
< |
threadAssertEquals(1, lock.getHoldCount()); |
848 |
> |
assertEquals(1, lock.getHoldCount()); |
849 |
|
c.await(); |
850 |
< |
threadAssertEquals(1, lock.getHoldCount()); |
850 |
> |
assertEquals(1, lock.getHoldCount()); |
851 |
|
lock.unlock(); |
852 |
|
}}); |
853 |
|
|
855 |
|
public void realRun() throws InterruptedException { |
856 |
|
lock.lock(); |
857 |
|
lock.lock(); |
858 |
< |
threadAssertEquals(2, lock.getHoldCount()); |
858 |
> |
assertEquals(2, lock.getHoldCount()); |
859 |
|
c.await(); |
860 |
< |
threadAssertEquals(2, lock.getHoldCount()); |
860 |
> |
assertEquals(2, lock.getHoldCount()); |
861 |
|
lock.unlock(); |
862 |
|
lock.unlock(); |
863 |
|
}}); |