better seeding
authorClaus Gittinger <cg@exept.de>
Wed, 01 Oct 2014 17:17:12 +0200
changeset 3387 53b0bb1779f1
parent 3386 dc41f6b4fa89
child 3388 379593c9d8ae
better seeding
Random.st
--- a/Random.st	Wed Oct 01 17:17:10 2014 +0200
+++ b/Random.st	Wed Oct 01 17:17:12 2014 +0200
@@ -278,7 +278,7 @@
     [
         newSeed := newSeed bitXor:(OperatingSystem getCPUCycleCount).
     ] on:PrimitiveFailure do:[].
-
+    newSeed = 0 ifTrue:[ newSeed := Time microsecondClockValue ]. "/ how likely is that
     ^ newSeed.
 
     "
@@ -736,10 +736,10 @@
 !Random class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.52 2014-10-01 15:14:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.53 2014-10-01 15:17:12 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.52 2014-10-01 15:14:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.53 2014-10-01 15:17:12 cg Exp $'
 ! !