ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java
(Generate patch)

Comparing jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java (file contents):
Revision 1.4 by dl, Mon Dec 29 19:05:40 2003 UTC vs.
Revision 1.5 by dl, Tue Dec 30 15:48:38 2003 UTC

# Line 32 | Line 32 | public class AbstractQueuedSynchronizerT
32          private static class Sync extends AbstractQueuedSynchronizer {
33              public int acquireExclusiveState(boolean isQueued, int acquires) {
34                  assert acquires == 1; // Does not use multiple acquires
35 <                return state().compareAndSet(0, 1)? 0 : -1;
35 >                return compareAndSet(0, 1)? 0 : -1;
36              }
37              
38              public boolean releaseExclusiveState(int releases) {
39 <                state().set(0);
39 >                set(0);
40                  return true;
41              }
42              
43            public int acquireSharedState(boolean isQueued, int acquires) {
44                throw new UnsupportedOperationException();
45            }
46            
47            public boolean releaseSharedState(int releases) {
48                throw new UnsupportedOperationException();
49            }
50            
43              public void checkConditionAccess(Thread thread, boolean waiting) {
44 <                if (state().get() == 0) throw new IllegalMonitorStateException();
44 >                if (get() == 0) throw new IllegalMonitorStateException();
45              }
46              
47              Condition newCondition() { return new ConditionObject(); }
48              
49              private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
50                  s.defaultReadObject();
51 <                state().set(0); // reset to unlocked state
51 >                set(0); // reset to unlocked state
52              }
53          }
54          
# Line 75 | Line 67 | public class AbstractQueuedSynchronizerT
67          }
68          public void unlock() { sync.releaseExclusive(1); }
69          public Condition newCondition() { return sync.newCondition(); }
70 <        public boolean isLocked() { return sync.state().get() != 0; }
70 >        public boolean isLocked() { return sync.get() != 0; }
71          public boolean hasQueuedThreads() { return sync.hasQueuedThreads(); }
72      }
73  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines