ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CountDownLatch.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CountDownLatch.java (file contents):
Revision 1.18 by dl, Fri Jan 2 21:02:31 2004 UTC vs.
Revision 1.19 by dl, Wed Jan 7 01:00:50 2004 UTC

# Line 136 | Line 136 | public class CountDownLatch {
136              return getState();
137          }
138  
139 <        public int tryAcquireShared(boolean isQueued, int acquires) {
139 >        public int tryAcquireShared(int acquires) {
140              return getState() == 0? 1 : -1;
141          }
142          
# Line 146 | Line 146 | public class CountDownLatch {
146                  int c = getState();
147                  if (c == 0)
148                      return false;
149 <                if (compareAndSetState(c, c-1))
150 <                    return c == 1;
149 >                int nextc = c-1;
150 >                if (compareAndSetState(c, nextc))
151 >                    return nextc == 0;
152              }
153          }
154      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines