Namespaces |
| namespace | anonymous_namespace{Random.cc} |
Functions |
| void | acquireMutex () |
| | Called before fork() to grab the mutex used in pthread_atfork.
|
| void | releaseMutex () |
| | Called in the parent post fork().
|
| uint8_t | random8 () |
| | Return one random byte.
|
| uint16_t | random16 () |
| | Return two random bytes.
|
| uint32_t | random32 () |
| | Return four random bytes.
|
| uint64_t | random64 () |
| | Return eight random bytes.
|
| double | randomRangeDouble (double start, double end) |
| | Return a random floating point number between start and end, inclusive.
|
| uint64_t | randomRange (uint64_t start, uint64_t end) |
| | Return a random integer between start and end, inclusive.
|
Thread-safe pseudo-random number generator.
- Warning:
- Don't call these functions from static initializers or you might run into the static initialization order fiasco.