--- jsr166/src/jsr166e/LongAdderTable.java 2011/07/31 14:20:01 1.1
+++ jsr166/src/jsr166e/LongAdderTable.java 2012/11/18 03:07:22 1.10
@@ -4,41 +4,44 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
-package jsr166e.extra;
+package jsr166e;
import jsr166e.LongAdder;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.Map;
import java.util.Set;
import java.io.Serializable;
/**
* A keyed table of adders, that may be useful in computing frequency
- * counts and histograms, or may be used a form of multiset. A {@link
- * LongAdder} is associated with each key. Keys are added to the table
- * implicitly upon any attempt to update, or may be added explicitly
- * using method {@link #install}.
+ * counts and histograms, or may be used as a form of multiset. A
+ * {@link LongAdder} is associated with each key. Keys are added to
+ * the table implicitly upon any attempt to update, or may be added
+ * explicitly using method {@link #install}.
*
*
jsr166e note: This class is targeted to be placed in
- * java.util.concurrent.atomic
+ * java.util.concurrent.atomic.
*
+ * @since 1.8
* @author Doug Lea
*/
public class LongAdderTable implements Serializable {
/** Relies on default serialization */
private static final long serialVersionUID = 7249369246863182397L;
- /** Concurrency parameter for map -- we assume high contention */
- private static final int MAP_SEGMENTS =
- Math.max(16, Runtime.getRuntime().availableProcessors());
-
/** The underlying map */
- private final ConcurrentHashMap map;
+ private final ConcurrentHashMapV8 map;
+
+ static final class CreateAdder
+ implements ConcurrentHashMapV8.Fun