254 |
|
} |
255 |
|
|
256 |
|
/** |
257 |
< |
* timed tryAcquireExclusive is interruptible. |
257 |
> |
* acquireExclusiveNanos is interruptible. |
258 |
|
*/ |
259 |
|
public void testInterruptedException2() { |
260 |
|
final Mutex lock = new Mutex(); |
297 |
|
} |
298 |
|
|
299 |
|
/** |
300 |
< |
* acquireExclusiveTimed on a locked lock times out |
300 |
> |
* acquireExclusiveNanos on a locked lock times out |
301 |
|
*/ |
302 |
< |
public void testacquireExclusiveTimed_Timeout() { |
302 |
> |
public void testAcquireExclusiveNanos_Timeout() { |
303 |
|
final Mutex lock = new Mutex(); |
304 |
|
lock.acquireExclusiveUninterruptibly(1); |
305 |
|
Thread t = new Thread(new Runnable() { |
322 |
|
|
323 |
|
|
324 |
|
/** |
325 |
< |
* isLocked is true when locked and false when not |
325 |
> |
* getState is true when acquired and false when not |
326 |
|
*/ |
327 |
< |
public void testIsLocked() { |
327 |
> |
public void testGetState() { |
328 |
|
final Mutex lock = new Mutex(); |
329 |
|
lock.acquireExclusiveUninterruptibly(1); |
330 |
|
assertTrue(lock.isLocked()); |
534 |
|
/** |
535 |
|
* release and has no effect when already signalled |
536 |
|
*/ |
537 |
< |
public void testLatchBoolean() { |
537 |
> |
public void testReleaseShared() { |
538 |
|
final BooleanLatch l = new BooleanLatch(); |
539 |
|
assertFalse(l.isSignalled()); |
540 |
|
l.releaseShared(0); |
546 |
|
/** |
547 |
|
* acquireSharedInterruptibly returns after release, but not before |
548 |
|
*/ |
549 |
< |
public void testLatchAcquireSharedInterruptibly() { |
549 |
> |
public void testAcquireSharedInterruptibly() { |
550 |
|
final BooleanLatch l = new BooleanLatch(); |
551 |
|
|
552 |
|
Thread t = new Thread(new Runnable() { |
576 |
|
/** |
577 |
|
* acquireSharedTimed returns after release |
578 |
|
*/ |
579 |
< |
public void testLatchTimedacquireSharedInterruptibly() { |
579 |
> |
public void testAsquireSharedTimed() { |
580 |
|
final BooleanLatch l = new BooleanLatch(); |
581 |
|
|
582 |
|
Thread t = new Thread(new Runnable() { |
606 |
|
/** |
607 |
|
* acquireSharedInterruptibly throws IE if interrupted before released |
608 |
|
*/ |
609 |
< |
public void testLatchAcquireSharedInterruptibly_InterruptedException() { |
609 |
> |
public void testAcquireSharedInterruptibly_InterruptedException() { |
610 |
|
final BooleanLatch l = new BooleanLatch(); |
611 |
|
Thread t = new Thread(new Runnable() { |
612 |
|
public void run() { |
630 |
|
/** |
631 |
|
* acquireSharedTimed throws IE if interrupted before released |
632 |
|
*/ |
633 |
< |
public void testLatchTimedAwait_InterruptedException() { |
633 |
> |
public void testAcquireSharedNanos_InterruptedException() { |
634 |
|
final BooleanLatch l = new BooleanLatch(); |
635 |
|
Thread t = new Thread(new Runnable() { |
636 |
|
public void run() { |
655 |
|
/** |
656 |
|
* acquireSharedTimed times out if not released before timeout |
657 |
|
*/ |
658 |
< |
public void testLatchAwaitTimeout() { |
658 |
> |
public void testAcquireSharedNanos_Timeout() { |
659 |
|
final BooleanLatch l = new BooleanLatch(); |
660 |
|
Thread t = new Thread(new Runnable() { |
661 |
|
public void run() { |