File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1010#include " config/pivx-config.h"
1111#endif
1212
13- #include < boost/random/mersenne_twister.hpp>
14- #include < boost/random/uniform_int_distribution.hpp>
1513#include < boost/thread.hpp>
1614#include < boost/test/unit_test.hpp>
1715
@@ -46,10 +44,10 @@ BOOST_AUTO_TEST_CASE(manythreads)
4644
4745 boost::mutex counterMutex[10 ];
4846 int counter[10 ] = { 0 };
49- boost::random::mt19937 rng (42 );
50- boost::random::uniform_int_distribution<> zeroToNine ( 0 , 9 );
51- boost::random::uniform_int_distribution<> randomMsec (- 11 , 1000 );
52- boost::random::uniform_int_distribution<> randomDelta (- 1000 , 1000 );
47+ FastRandomContext rng (42 );
48+ auto zeroToNine = [](FastRandomContext& rc) -> int { return rc. randrange ( 10 ); }; // [ 0, 9]
49+ auto randomMsec = [](FastRandomContext& rc) -> int { return - 11 + rc. randrange ( 1012 ); }; // [-11, 1000]
50+ auto randomDelta = [](FastRandomContext& rc) -> int { return - 1000 + rc. randrange ( 2001 ); }; // [-1000, 1000]
5351
5452 std::chrono::system_clock::time_point start = std::chrono::system_clock::now ();
5553 std::chrono::system_clock::time_point now = start;
You can’t perform that action at this time.
0 commit comments