8157318: ThreadedSeedGenerator uses System.currentTimeMillis and stops generating when time is set back
authorweijun
Tue, 21 Jun 2016 11:09:13 +0800
changeset 39127 2c67712d6935
parent 39126 1d9492ef71e9
child 39128 e991a1c8b41b
8157318: ThreadedSeedGenerator uses System.currentTimeMillis and stops generating when time is set back Reviewed-by: xuelei, wetmore
jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java
--- a/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java	Mon Jun 20 19:31:03 2016 -0700
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SeedGenerator.java	Tue Jun 21 11:09:13 2016 +0800
@@ -354,8 +354,8 @@
                         // We wait 250milli quanta, so the minimum wait time
                         // cannot be under 250milli.
                         int latch = 0;
-                        long l = System.currentTimeMillis() + 250;
-                        while (System.currentTimeMillis() < l) {
+                        long startTime = System.nanoTime();
+                        while (System.nanoTime() - startTime < 250000000) {
                             synchronized(this){};
                             latch++;
                         }