8157318: ThreadedSeedGenerator uses System.currentTimeMillis and stops generating when time is set back
Reviewed-by: xuelei, wetmore
--- 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++;
}