X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2Flib%2Frandom.cpp;h=1d9a20c9a9b166e0b5beda1743a04e5ffcfcb906;hb=77fc9c3ba95eb502d1a66146251acfcfd5606df8;hp=6aab887597f087e75b823f24773cf0515845c11d;hpb=a1b265e9eba018e9ea510c9224953c27fc271bc9;p=awesomized%2Flibmemcached diff --git a/test/lib/random.cpp b/test/lib/random.cpp index 6aab8875..1d9a20c9 100644 --- a/test/lib/random.cpp +++ b/test/lib/random.cpp @@ -3,6 +3,16 @@ #include // getpid() +mt19937_64 rnd_eng; +mutex rnd_mtx; + +void random_setup() { + using namespace chrono; + + auto time = duration_cast(system_clock::now().time_since_epoch()); + rnd_eng.seed(static_cast(time.count())); +} + unsigned random_port() { do { auto port = random_num(5000, 32000);