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

Comparing jsr166/src/test/loops/ConcurrentHashSet.java (file contents):
Revision 1.1 by dl, Mon Nov 28 15:40:56 2005 UTC vs.
Revision 1.4 by jsr166, Wed Dec 31 17:00:58 2014 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   // A set wrapper over CHM for testing
8  
9 + import java.io.*;
10   import java.util.*;
11   import java.util.concurrent.*;
11 import java.io.*;
12  
13   public class ConcurrentHashSet<E> extends AbstractSet<E>
14      implements Set<E>, Serializable {
15  
16      private final ConcurrentHashMap<E, Boolean> m;  // The backing map
17      private transient Set<E> keySet;  // Its keySet
18 <    
19 <    public ConcurrentHashSet() {
18 >
19 >    public ConcurrentHashSet() {
20          m = new ConcurrentHashMap<E, Boolean>();
21          keySet = m.keySet();
22      }
# Line 24 | Line 24 | public class ConcurrentHashSet<E> extend
24          m = new ConcurrentHashMap<E, Boolean>(initialCapacity);
25          keySet = m.keySet();
26      }
27 <    public ConcurrentHashSet(int initialCapacity, float loadFactor,
27 >    public ConcurrentHashSet(int initialCapacity, float loadFactor,
28                               int concurrencyLevel) {
29 <        m = new ConcurrentHashMap<E, Boolean>(initialCapacity, loadFactor,
29 >        m = new ConcurrentHashMap<E, Boolean>(initialCapacity, loadFactor,
30                                                concurrencyLevel);
31          keySet = m.keySet();
32      }
# Line 61 | Line 61 | public class ConcurrentHashSet<E> extend
61          keySet = m.keySet();
62      }
63   }
64

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines