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 88#include " test/test_bitcoin.h"
99
1010#include < boost/bind.hpp>
11- #include < boost/random/mersenne_twister.hpp>
12- #include < boost/random/uniform_int_distribution.hpp>
1311#include < boost/thread.hpp>
1412#include < boost/test/unit_test.hpp>
1513
@@ -56,10 +54,10 @@ BOOST_AUTO_TEST_CASE(manythreads)
5654
5755 boost::mutex counterMutex[10 ];
5856 int counter[10 ] = { 0 };
59- boost::random::mt19937 rng (42 );
60- boost::random::uniform_int_distribution<> zeroToNine ( 0 , 9 );
61- boost::random::uniform_int_distribution<> randomMsec (- 11 , 1000 );
62- boost::random::uniform_int_distribution<> randomDelta (- 1000 , 1000 );
57+ FastRandomContext rng (42 );
58+ auto zeroToNine = [](FastRandomContext& rc) -> int { return rc. randrange ( 10 ); }; // [ 0, 9]
59+ auto randomMsec = [](FastRandomContext& rc) -> int { return - 11 + rc. randrange ( 1012 ); }; // [-11, 1000]
60+ auto randomDelta = [](FastRandomContext& rc) -> int { return - 1000 + rc. randrange ( 2001 ); }; // [-1000, 1000]
6361
6462 boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now ();
6563 boost::chrono::system_clock::time_point now = start;
You can’t perform that action at this time.
0 commit comments