fortuna: use a once_flag in initialize_prng()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
01de51dc73
commit
e706de7702
@ -51,6 +51,8 @@ public:
|
||||
|
||||
auto initialize_prng() -> void {
|
||||
try {
|
||||
std::call_once(PRNG_init, [] { ; });
|
||||
|
||||
set_reseed_ctr_to_null();
|
||||
|
||||
std::scoped_lock sl(mtx_accu, mtx_p_pools);
|
||||
@ -116,6 +118,7 @@ public:
|
||||
|
||||
std::latch sync_point{1}; // wait for init before spawning the threads
|
||||
std::latch die_point{2}; // wait for service threads to die
|
||||
std::once_flag PRNG_init;
|
||||
|
||||
}; // class Fortuna
|
||||
|
||||
|
Reference in New Issue
Block a user