LogCabin
|
Keeps state needed by the random number generator, protected by a mutex. More...
Public Member Functions | |
RandomState () | |
void | reset () |
uint64_t | random64 () |
Private Types | |
enum | { STATE_BYTES } |
Size of 'statebuf'. More... | |
Private Attributes | |
std::mutex | mutex |
Protect following members from concurrent access. | |
bool | init |
Set to true when the constructor completes. | |
char | statebuf [STATE_BYTES] |
Internal scratch state used by random_r. | |
random_data | randbuf |
random_r's state. | |
Friends | |
void | LogCabin::Core::Random::acquireMutex () |
void | LogCabin::Core::Random::releaseMutex () |
Keeps state needed by the random number generator, protected by a mutex.
anonymous enum [private] |
LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::RandomState | ( | ) | [inline] |
void LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::reset | ( | ) | [inline] |
uint64_t LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::random64 | ( | ) | [inline] |
void LogCabin::Core::Random::acquireMutex | ( | ) | [friend] |
void LogCabin::Core::Random::releaseMutex | ( | ) | [friend] |
std::mutex LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::mutex [private] |
bool LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::init [private] |
char LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::statebuf[STATE_BYTES] [private] |
random_data LogCabin::Core::Random::anonymous_namespace{Random.cc}::RandomState::randbuf [private] |