Метод | Описание | |
---|---|---|
Bool ( ) : bool |
Thread-safe wrapper for Bool().
|
|
Byte ( ) : byte |
Thread-safe wrapper for Byte().
|
|
Bytes ( int length ) : byte[] |
Thread-safe wrapper for Bytes().
|
|
Enter ( ) : void |
Same as a call to Monitor.Enter() on the RNG-object (not the ThreadSafe-object). Useful if you need to generate several random numbers in a batch without having to reacquire the lock for each call to the RNG.
|
|
Exit ( ) : void |
Same as a call to Monitor.Exit() on the RNG-object (not the ThreadSafe-object). Must be called once for each call to Enter() to release the lock again.
|
|
Gauss ( ) : double |
Thread-safe wrapper for Gauss(). The default implementation calls Uniform() a number of times. This wrapper therefore locks the RNG-object for the entirety of these multiple calls, instead of locking for each separate call to Uniform(). |
|
Uniform ( ) : double |
Thread-safe wrapper for Uniform(). Note that derived methods that rely on Uniform() to create their random numbers, e.g. Gauss(), will automatically also be thread-safe.
|
|
Wrapper ( |
Construct the thread-safe RNG wrapper.
|
public final Bytes ( int length ) : byte[] | ||
length | int | Number of random bytes to return. |
Результат | byte[] |
public Wrapper ( |
||
rand | The RNG to be made thread-safe. | |
Результат | System |