--- jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2003/12/29 19:05:40 1.4 +++ jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java 2003/12/30 15:48:38 1.5 @@ -32,31 +32,23 @@ public class AbstractQueuedSynchronizerT private static class Sync extends AbstractQueuedSynchronizer { public int acquireExclusiveState(boolean isQueued, int acquires) { assert acquires == 1; // Does not use multiple acquires - return state().compareAndSet(0, 1)? 0 : -1; + return compareAndSet(0, 1)? 0 : -1; } public boolean releaseExclusiveState(int releases) { - state().set(0); + set(0); return true; } - public int acquireSharedState(boolean isQueued, int acquires) { - throw new UnsupportedOperationException(); - } - - public boolean releaseSharedState(int releases) { - throw new UnsupportedOperationException(); - } - public void checkConditionAccess(Thread thread, boolean waiting) { - if (state().get() == 0) throw new IllegalMonitorStateException(); + if (get() == 0) throw new IllegalMonitorStateException(); } Condition newCondition() { return new ConditionObject(); } private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); - state().set(0); // reset to unlocked state + set(0); // reset to unlocked state } } @@ -75,7 +67,7 @@ public class AbstractQueuedSynchronizerT } public void unlock() { sync.releaseExclusive(1); } public Condition newCondition() { return sync.newCondition(); } - public boolean isLocked() { return sync.state().get() != 0; } + public boolean isLocked() { return sync.get() != 0; } public boolean hasQueuedThreads() { return sync.hasQueuedThreads(); } }