Package org.apache.myfaces.util.lang
Class ThreadsafeXorShiftRandom
java.lang.Object
org.apache.myfaces.util.lang.XorShiftRandom
org.apache.myfaces.util.lang.ThreadsafeXorShiftRandom
A threadsafe implementation of
XorShiftRandom
.
We use a ThreadLocal to give each thread it's own implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
random()
We use the random generator for this very thread.Methods inherited from class org.apache.myfaces.util.lang.XorShiftRandom
random
-
Constructor Details
-
ThreadsafeXorShiftRandom
public ThreadsafeXorShiftRandom()
-
-
Method Details
-
random
public long random()We use the random generator for this very thread. This method is perfectly threadsafe. It is also guaranteed that each thread will get own values.- Overrides:
random
in classXorShiftRandom
- Returns:
-