[cp-patches] RFC: fix for PR 24642

Jeroen Frijters jeroen at sumatra.nl
Thu Apr 13 06:58:07 UTC 2006

Casey Marshall wrote:
> This patch implements seeding of all SecureRandom instances if you  
> call `nextBytes' without providing a seed yourself, and provides a  
> better implementation of the static `getSeed' method.
> This introduces a new VM class, `java.security.VMSecureRandom,' that  
> contains a single static method for generating real (or close to  
> real) random seed values. The default implementation uses a set of  
> eight "dueling" threads, each of which increments a counter in a  
> tight loop.

I like this approach (as a default).

+    private byte value;
+    private boolean running;

For it to work consistently on all VMs both the "value" and "running"
field in Spinner must be marked volatile.


More information about the Classpath-patches mailing list