projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
bin: move memaslap to contrib
[awesomized/libmemcached]
/
test
/
lib
/
random.cpp
diff --git
a/test/lib/random.cpp
b/test/lib/random.cpp
index 6aab887597f087e75b823f24773cf0515845c11d..1d9a20c9a9b166e0b5beda1743a04e5ffcfcb906 100644
(file)
--- a/
test/lib/random.cpp
+++ b/
test/lib/random.cpp
@@
-3,6
+3,16
@@
#include <unistd.h> // getpid()
#include <unistd.h> // getpid()
+mt19937_64 rnd_eng;
+mutex rnd_mtx;
+
+void random_setup() {
+ using namespace chrono;
+
+ auto time = duration_cast<nanoseconds>(system_clock::now().time_since_epoch());
+ rnd_eng.seed(static_cast<mt19937_64::result_type>(time.count()));
+}
+
unsigned random_port() {
do {
auto port = random_num(5000, 32000);
unsigned random_port() {
do {
auto port = random_num(5000, 32000);