39#include "blocxx/BLOCXX_config.h"
49#ifdef BLOCXX_HAVE_UNISTD_H
53#ifdef BLOCXX_HAVE_SYS_TIME_H
66OnceFlag guard = BLOCXX_ONCE_INIT;
87 time_t timeval = ::time(NULL);
94 std::ifstream infile(
"/dev/urandom", std::ios::in);
97 infile.open(
"/dev/random", std::ios::in);
101 unsigned int dev_rand_input;
104 infile.read(
reinterpret_cast<char*
>(&dev_rand_input),
sizeof(dev_rand_input));
108 seed = dev_rand_input ^ (getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec;
110#ifdef BLOCXX_HAVE_SRANDOM
133#ifdef BLOCXX_HAVE_RANDOM
#define BLOCXX_GLOBAL_MUTEX_INIT()
static void saveRandomState()
RandomNumber(Int32 lowVal=0, Int32 highVal=RAND_MAX)
static void initRandomness()
void BLOCXX_COMMON_API callOnce(OnceFlag &flag, FuncT F)
The first time callOnce is called with a given onceFlag argument, it calls func with no argument and ...
LazyGlobal< Mutex, int, GlobalMutexFactory > GlobalMutex