diff --git a/flow/IRandom.h b/flow/IRandom.h index 7201404a32..0a1716e3f9 100644 --- a/flow/IRandom.h +++ b/flow/IRandom.h @@ -127,6 +127,8 @@ void setThreadLocalDeterministicRandomSeed(uint32_t seed); // Returns the random number generator that can be seeded. This generator should only // be used in contexts where the choice to call it is deterministic. +// +// This generator is only deterministic if given a seed using setThreadLocalDeterministicRandomSeed Reference deterministicRandom(); // A random number generator that cannot be manually seeded and may be called in diff --git a/flow/flow.cpp b/flow/flow.cpp index 98a2e484f4..55b5e637e7 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -37,7 +37,7 @@ void setThreadLocalDeterministicRandomSeed(uint32_t seed) { Reference deterministicRandom() { if(!seededRandom) { - seededRandom = Reference(new DeterministicRandom(1, true)); + seededRandom = Reference(new DeterministicRandom(platform::getRandomSeed(), true)); } return seededRandom; }