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.13 by dl, Mon Nov 3 00:11:46 2003 UTC vs.
Revision 1.14 by dl, Tue Dec 23 19:38:09 2003 UTC

# Line 167 | Line 167 | public class CountDownLatch {
167       * while waiting.
168       */
169      public void await() throws InterruptedException {
170 +        final ReentrantLock lock = this.lock;
171          lock.lock();
172          try {
173              while (count != 0)
# Line 221 | Line 222 | public class CountDownLatch {
222      public boolean await(long timeout, TimeUnit unit)
223          throws InterruptedException {
224          long nanos = unit.toNanos(timeout);
225 +        final ReentrantLock lock = this.lock;
226          lock.lock();
227          try {
228              for (;;) {
# Line 247 | Line 249 | public class CountDownLatch {
249       * happens.
250       */
251      public void countDown() {
252 +        final ReentrantLock lock = this.lock;
253          lock.lock();
254          try {
255              if (count > 0 && --count == 0)
# Line 262 | Line 265 | public class CountDownLatch {
265       * @return the current count.
266       */
267      public long getCount() {
268 +        final ReentrantLock lock = this.lock;
269          lock.lock();
270          try {
271              return count;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines