Move random number re-seeding out of the hot path
Instead of checking if we need to re-seed for every isc_random call, seed the random number generator in the libisc global initializer and the per-thread initializer.
This commit is contained in:
@@ -87,6 +87,11 @@ _setup(void **state) {
|
||||
result = isc_test_begin(NULL, true, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
* Ensure the RNG has been seeded.
|
||||
*/
|
||||
assert_int_not_equal(isc_random32(), 0);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user