ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java (file contents):
Revision 1.121 by jsr166, Fri Apr 19 18:18:08 2013 UTC vs.
Revision 1.122 by dl, Sun May 5 19:25:01 2013 UTC

# Line 825 | Line 825 | public class ConcurrentSkipListMap<K,V>
825              }
826          }
827  
828 <        int rnd; // generate a random level
829 <        Thread thread = Thread.currentThread();
830 <        if ((rnd = UNSAFE.getInt(thread, SECONDARY)) == 0)  // initialize
831 <            rnd = ThreadLocalRandom.current().nextInt();
832 <        rnd ^= rnd << 13;   // xorshift
833 <        rnd ^= rnd >>> 17;
834 <        rnd ^= rnd << 5;
835 <        UNSAFE.putInt(thread, SECONDARY, rnd);
828 >        int rnd = ThreadLocalRandom.nextSecondarySeed();
829          if ((rnd & 0x80000001) == 0) { // test highest and lowest bits
830              int level = 1, max;
831              while (((rnd >>>= 1) & 1) != 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines