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

Comparing jsr166/src/main/java/util/concurrent/Semaphore.java (file contents):
Revision 1.73 by jsr166, Tue Feb 17 18:55:39 2015 UTC vs.
Revision 1.74 by jsr166, Tue Aug 30 19:44:46 2016 UTC

# Line 43 | Line 43 | import java.util.concurrent.locks.Abstra
43   *   protected synchronized Object getNextAvailableItem() {
44   *     for (int i = 0; i < MAX_AVAILABLE; ++i) {
45   *       if (!used[i]) {
46 < *          used[i] = true;
47 < *          return items[i];
46 > *         used[i] = true;
47 > *         return items[i];
48   *       }
49   *     }
50   *     return null; // not reached
# Line 53 | Line 53 | import java.util.concurrent.locks.Abstra
53   *   protected synchronized boolean markAsUnused(Object item) {
54   *     for (int i = 0; i < MAX_AVAILABLE; ++i) {
55   *       if (item == items[i]) {
56 < *          if (used[i]) {
57 < *            used[i] = false;
58 < *            return true;
59 < *          } else
60 < *            return false;
56 > *         if (used[i]) {
57 > *           used[i] = false;
58 > *           return true;
59 > *         } else
60 > *           return false;
61   *       }
62   *     }
63   *     return false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines