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

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.30 by jsr166, Sun Oct 9 19:57:49 2011 UTC vs.
Revision 1.36 by jsr166, Mon Jan 2 23:46:33 2012 UTC

# Line 71 | Line 71 | import java.io.Serializable;
71   * versions of this class, constructors may optionally specify an
72   * expected {@code concurrencyLevel} as an additional hint for
73   * internal sizing.  Note that using many keys with exactly the same
74 < * {@code hashCode{}} is a sure way to slow down performance of any
74 > * {@code hashCode()} is a sure way to slow down performance of any
75   * hash table.
76   *
77   * <p>This class and its views and iterators implement all of the
# Line 351 | Line 351 | public class ConcurrentHashMapV8<K, V>
351       * Encodings for special uses of Node hash fields. See above for
352       * explanation.
353       */
354 <    static final int MOVED     = 0x80000000; // hash field for fowarding nodes
354 >    static final int MOVED     = 0x80000000; // hash field for forwarding nodes
355      static final int LOCKED    = 0x40000000; // set/tested only as a bit
356      static final int WAITING   = 0xc0000000; // both bits set/tested together
357      static final int HASH_BITS = 0x3fffffff; // usable bits of normal node hash
# Line 1150 | Line 1150 | public class ConcurrentHashMapV8<K, V>
1150                          continue;
1151                  }
1152                  else {             // transiently use a locked forwarding node
1153 <                    Node g =  new Node(MOVED|LOCKED, nextTab, null, null);
1153 >                    Node g = new Node(MOVED|LOCKED, nextTab, null, null);
1154                      if (!casTabAt(tab, i, f, g))
1155                          continue;
1156                      setTabAt(nextTab, i, null);
# Line 1291 | Line 1291 | public class ConcurrentHashMapV8<K, V>
1291       *
1292       * At each step, the iterator snapshots the key ("nextKey") and
1293       * value ("nextVal") of a valid node (i.e., one that, at point of
1294 <     * snapshot, has a nonnull user value). Because val fields can
1294 >     * snapshot, has a non-null user value). Because val fields can
1295       * change (including to null, indicating deletion), field nextVal
1296       * might not be accurate at point of use, but still maintains the
1297       * weak consistency property of holding a value that was once
# Line 1460 | Line 1460 | public class ConcurrentHashMapV8<K, V>
1460          if (initialCapacity < concurrencyLevel)   // Use at least as many bins
1461              initialCapacity = concurrencyLevel;   // as estimated threads
1462          long size = (long)(1.0 + (long)initialCapacity / loadFactor);
1463 <        int cap =  ((size >= (long)MAXIMUM_CAPACITY) ?
1464 <                    MAXIMUM_CAPACITY: tableSizeFor((int)size));
1463 >        int cap = ((size >= (long)MAXIMUM_CAPACITY) ?
1464 >                   MAXIMUM_CAPACITY: tableSizeFor((int)size));
1465          this.counter = new LongAdder();
1466          this.sizeCtl = cap;
1467      }
# Line 2187 | Line 2187 | public class ConcurrentHashMapV8<K, V>
2187              return true;
2188          }
2189  
2190 <        public final boolean removeAll(Collection c) {
2190 >        public final boolean removeAll(Collection<?> c) {
2191              boolean modified = false;
2192              for (Iterator<?> it = iter(); it.hasNext();) {
2193                  if (c.contains(it.next())) {
# Line 2237 | Line 2237 | public class ConcurrentHashMapV8<K, V>
2237      }
2238  
2239      static final class Values<K,V> extends MapView<K,V>
2240 <        implements Collection<V>  {
2240 >        implements Collection<V> {
2241          Values(ConcurrentHashMapV8<K, V> map)   { super(map); }
2242          public final boolean contains(Object o) { return map.containsValue(o); }
2243  
# Line 2267 | Line 2267 | public class ConcurrentHashMapV8<K, V>
2267          }
2268      }
2269  
2270 <    static final class EntrySet<K,V>  extends MapView<K,V>
2270 >    static final class EntrySet<K,V> extends MapView<K,V>
2271          implements Set<Map.Entry<K,V>> {
2272          EntrySet(ConcurrentHashMapV8<K, V> map) { super(map); }
2273  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines