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 8
8
#include " test/test_bitcoin.h"
9
9
10
10
#include < boost/bind.hpp>
11
- #include < boost/random/mersenne_twister.hpp>
12
- #include < boost/random/uniform_int_distribution.hpp>
13
11
#include < boost/thread.hpp>
14
12
#include < boost/test/unit_test.hpp>
15
13
@@ -56,10 +54,10 @@ BOOST_AUTO_TEST_CASE(manythreads)
56
54
57
55
boost::mutex counterMutex[10 ];
58
56
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]
63
61
64
62
boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now ();
65
63
boost::chrono::system_clock::time_point now = start;
You can’t perform that action at this time.
0 commit comments