"examples/ssl/data_modules/_utils.py" did not exist on "274330505ebb9329418bf7c5f2bb4d43bb803113"
Unverified Commit 2db4928e authored by Muhammed Fatih BALIN's avatar Muhammed Fatih BALIN Committed by GitHub
Browse files

a better way to init threadlocal prng (#4808)


Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent 11c866ab
......@@ -57,7 +57,10 @@ class RandomEngine {
/**
* @brief Set the seed of this random number generator
*/
void SetSeed(uint32_t seed) { rng_.seed(seed + GetThreadId()); }
void SetSeed(uint32_t seed) {
std::seed_seq seq{seed, GetThreadId()};
rng_.seed(seq);
}
/**
* @brief Generate an arbitrary random 32-bit integer.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment