Initialize random number generator in main
The random number generator can be initialized when MaxScale's other systems are being initialized. This removes the need to initialized it when the function is used for the first time.
This commit is contained in:
@ -16,6 +16,20 @@
|
||||
|
||||
MXS_BEGIN_DECLS
|
||||
|
||||
extern unsigned int random_jkiss(void);
|
||||
/**
|
||||
* @brief Initialize the random number generator
|
||||
*
|
||||
* Uses /dev/urandom if available, and warms the generator up with 1000 iterations.
|
||||
*/
|
||||
void random_jkiss_init(void);
|
||||
|
||||
/**
|
||||
* @brief Return a pseudo-random number
|
||||
*
|
||||
* Return a pseudo-random number that satisfies major tests for random sequences.
|
||||
*
|
||||
* @return A random number
|
||||
*/
|
||||
unsigned int random_jkiss(void);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user