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

Comparing jsr166/src/extra166y/CustomConcurrentHashMap.java (file contents):
Revision 1.10 by dl, Fri Feb 12 12:38:25 2010 UTC vs.
Revision 1.11 by jsr166, Wed Sep 1 23:26:57 2010 UTC

# Line 2984 | Line 2984 | public class CustomConcurrentHashMap<K,
2984  
2985      // Temporary Unsafe mechanics for preliminary release
2986  
2987 <    static final Unsafe _unsafe;
2987 >    static final Unsafe UNSAFE;
2988      static final long tableBase;
2989      static final int tableShift;
2990      static final long segmentsBase;
# Line 3015 | Line 3015 | public class CustomConcurrentHashMap<K,
3015  
3016      static {
3017          try {
3018 <            _unsafe = getUnsafe();
3019 <            tableBase = _unsafe.arrayBaseOffset(Node[].class);
3020 <            int s = _unsafe.arrayIndexScale(Node[].class);
3018 >            UNSAFE = getUnsafe();
3019 >            tableBase = UNSAFE.arrayBaseOffset(Node[].class);
3020 >            int s = UNSAFE.arrayIndexScale(Node[].class);
3021              if ((s & (s-1)) != 0)
3022                  throw new Error("data type scale not a power of two");
3023              tableShift = 31 - Integer.numberOfLeadingZeros(s);
3024 <            segmentsBase = _unsafe.arrayBaseOffset(Segment[].class);
3025 <            s = _unsafe.arrayIndexScale(Segment[].class);
3024 >            segmentsBase = UNSAFE.arrayBaseOffset(Segment[].class);
3025 >            s = UNSAFE.arrayIndexScale(Segment[].class);
3026              if ((s & (s-1)) != 0)
3027                  throw new Error("data type scale not a power of two");
3028              segmentsShift = 31 - Integer.numberOfLeadingZeros(s);
# Line 3035 | Line 3035 | public class CustomConcurrentHashMap<K,
3035      static final  void storeNode(Node[] table,
3036                                   int i, Node r) {
3037          long nodeOffset = ((long) i << tableShift) + tableBase;
3038 <        _unsafe.putOrderedObject(table, nodeOffset, r);
3038 >        UNSAFE.putOrderedObject(table, nodeOffset, r);
3039      }
3040  
3041      static final  void storeSegment(Segment[] segs,
3042                                      int i, Segment s) {
3043          long segmentOffset = ((long) i << segmentsShift) + segmentsBase;
3044 <        _unsafe.putOrderedObject(segs, segmentOffset, s);
3044 >        UNSAFE.putOrderedObject(segs, segmentOffset, s);
3045      }
3046  
3047  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines