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

Comparing jsr166/src/main/java/util/concurrent/ThreadLocalRandom.java (file contents):
Revision 1.53 by jsr166, Mon Feb 20 22:07:50 2017 UTC vs.
Revision 1.54 by dl, Tue May 9 11:06:25 2017 UTC

# Line 20 | Line 20 | import java.util.stream.IntStream;
20   import java.util.stream.LongStream;
21   import java.util.stream.StreamSupport;
22   import jdk.internal.misc.Unsafe;
23 + import jdk.internal.misc.VM;
24  
25   /**
26   * A random number generator isolated to the current thread.  Like the
# Line 1064 | Line 1065 | public class ThreadLocalRandom extends R
1065  
1066      // at end of <clinit> to survive static initialization circularity
1067      static {
1068 <        if (java.security.AccessController.doPrivileged(
1069 <            new java.security.PrivilegedAction<>() {
1069 <                public Boolean run() {
1070 <                    return Boolean.getBoolean("java.util.secureRandomSeed");
1071 <                }})) {
1068 >        String sec = VM.getSavedProperty("java.util.secureRandomSeed");
1069 >        if (sec != null && Boolean.parseBoolean(sec)) {
1070              byte[] seedBytes = java.security.SecureRandom.getSeed(8);
1071              long s = (long)seedBytes[0] & 0xffL;
1072              for (int i = 1; i < 8; ++i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines