[cvs] / jsr166 / src / test / tck / AbstractQueuedSynchronizerTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Wed Dec 31 21:30:08 2003 UTC revision 1.7, Fri Jan 2 21:06:38 2004 UTC
# Line 32  Line 32 
32          private static class Sync extends AbstractQueuedSynchronizer {          private static class Sync extends AbstractQueuedSynchronizer {
33              boolean isLocked() { return getState() == 1; }              boolean isLocked() { return getState() == 1; }
34    
35              public boolean tryAcquireExclusiveState(boolean isQueued, int acquires) {              public boolean tryAcquireExclusive(boolean isQueued, int acquires) {
36                  assert acquires == 1; // Does not use multiple acquires                  assert acquires == 1; // Does not use multiple acquires
37                  return compareAndSetState(0, 1);                  return compareAndSetState(0, 1);
38              }              }
39    
40              public boolean releaseExclusiveState(int releases) {              public boolean tryReleaseExclusive(int releases) {
41                  setState(0);                  setState(0);
42                  return true;                  return true;
43              }              }
# Line 56  Line 56 
56    
57          private final Sync sync = new Sync();          private final Sync sync = new Sync();
58          public boolean tryLock() {          public boolean tryLock() {
59              return sync.tryAcquireExclusiveState(false, 1);              return sync.tryAcquireExclusive(false, 1);
60          }          }
61          public void lock() {          public void lock() {
62              sync.acquireExclusiveUninterruptibly(1);              sync.acquireExclusiveUninterruptibly(1);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8