85 |
|
* <p><em>jsr166e note: This class is a candidate replacement for |
86 |
|
* java.util.concurrent.ConcurrentHashMap.<em> |
87 |
|
* |
88 |
< |
* @since 1.8 |
88 |
> |
* @since 1.5 |
89 |
|
* @author Doug Lea |
90 |
|
* @param <K> the type of keys maintained by this map |
91 |
|
* @param <V> the type of mapped values |
152 |
|
* node of a bin list itself as a lock, using plain "synchronized" |
153 |
|
* locks. These save space and we can live with block-structured |
154 |
|
* lock/unlock operations. Using the first node of a list as a |
155 |
< |
* lock does not by itself suffice though: When a node is locked, |
155 |
> |
* lock does not by itself suffice though. When a node is locked, |
156 |
|
* any update must first validate that it is still the first node, |
157 |
|
* and retry if not. Because new nodes are always appended to |
158 |
|
* lists, once a node is first in a bin, it remains first until |
291 |
|
* special, and do not contain user keys or values. Otherwise, |
292 |
|
* keys are never null, and null val fields indicate that a node |
293 |
|
* is in the process of being deleted or created. For purposes of |
294 |
< |
* read-only, access, a key may be read before a val, but can only |
294 |
> |
* read-only access, a key may be read before a val, but can only |
295 |
|
* be used after checking val. (For an update operation, when a |
296 |
|
* lock is held on a node, order doesn't matter.) |
297 |
|
*/ |
771 |
|
* valid. |
772 |
|
* |
773 |
|
* Internal traversals directly access these fields, as in: |
774 |
< |
* {@code while (it.next != null) { process(nextKey); it.advance(); }} |
774 |
> |
* {@code while (it.next != null) { process(it.nextKey); it.advance(); }} |
775 |
|
* |
776 |
|
* Exported iterators (subclasses of ViewIterator) extract key, |
777 |
|
* value, or key-value pairs as return values of Iterator.next(), |
901 |
|
* establishing the initial table size |
902 |
|
* @throws IllegalArgumentException if the initial capacity of |
903 |
|
* elements is negative or the load factor is nonpositive |
904 |
+ |
* |
905 |
+ |
* @since 1.6 |
906 |
|
*/ |
907 |
|
public ConcurrentHashMapV8(int initialCapacity, float loadFactor) { |
908 |
|
this(initialCapacity, loadFactor, 1); |
1624 |
|
throws java.io.IOException, ClassNotFoundException { |
1625 |
|
s.defaultReadObject(); |
1626 |
|
this.segments = null; // unneeded |
1627 |
< |
// initalize transient final field |
1627 |
> |
// initialize transient final field |
1628 |
|
UNSAFE.putObjectVolatile(this, counterOffset, new LongAdder()); |
1629 |
|
this.targetCapacity = DEFAULT_CAPACITY; |
1630 |
|
|