--- jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2003/12/28 21:56:18 1.1 +++ jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2003/12/29 19:05:40 1.4 @@ -30,7 +30,7 @@ public class AbstractQueuedSynchronizerT */ static class Mutex implements Lock, java.io.Serializable { private static class Sync extends AbstractQueuedSynchronizer { - public int acquireExclusiveState(boolean isQueued, int acquires, Thread current) { + public int acquireExclusiveState(boolean isQueued, int acquires) { assert acquires == 1; // Does not use multiple acquires return state().compareAndSet(0, 1)? 0 : -1; } @@ -40,7 +40,7 @@ public class AbstractQueuedSynchronizerT return true; } - public int acquireSharedState(boolean isQueued, int acquires, Thread current) { + public int acquireSharedState(boolean isQueued, int acquires) { throw new UnsupportedOperationException(); } @@ -61,9 +61,11 @@ public class AbstractQueuedSynchronizerT } private final Sync sync = new Sync(); - public void lock() { sync.acquireExclusiveUninterruptibly(1); } public boolean tryLock() { - return sync.acquireExclusiveState(false, 1, null) >= 0; + return sync.acquireExclusiveState(false, 1) >= 0; + } + public void lock() { + sync.acquireExclusiveUninterruptibly(1); } public void lockInterruptibly() throws InterruptedException { sync.acquireExclusiveInterruptibly(1); @@ -117,7 +119,7 @@ public class AbstractQueuedSynchronizerT } /** - * trylock on an unlocked lock succeeds + * tryLock on an unlocked lock succeeds */ public void testTryLock() { Mutex rl = new Mutex(); @@ -156,7 +158,7 @@ public class AbstractQueuedSynchronizerT } /** - * timed trylock is interruptible. + * timed tryLock is interruptible. */ public void testInterruptedException2() { final Mutex lock = new Mutex(); @@ -179,7 +181,7 @@ public class AbstractQueuedSynchronizerT /** - * Trylock on a locked lock fails + * TryLock on a locked lock fails */ public void testTryLockWhenLocked() { final Mutex lock = new Mutex(); @@ -199,7 +201,7 @@ public class AbstractQueuedSynchronizerT } /** - * Timed trylock on a locked lock times out + * Timed tryLock on a locked lock times out */ public void testTryLock_Timeout() { final Mutex lock = new Mutex();