diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-04-18 01:51:05 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-04-18 01:51:05 +0300 |
commit | 27abd1a4f4c7a3d092d59edbbaa1e0f324c8b0ef (patch) | |
tree | 48d352c3dbfde48af374080cdf4d04bcc14aab06 /src/test/scheduler_tests.cpp | |
parent | 895c71e53557ce0385181191270c660fc6c32ce1 (diff) | |
download | bitcoin-27abd1a4f4c7a3d092d59edbbaa1e0f324c8b0ef.tar.xz |
test: Replace boost::mutex with std::mutex
Diffstat (limited to 'src/test/scheduler_tests.cpp')
-rw-r--r-- | src/test/scheduler_tests.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index 05482dfc4e..1395a7f38c 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -9,12 +9,14 @@ #include <boost/test/unit_test.hpp> #include <boost/thread.hpp> +#include <mutex> + BOOST_AUTO_TEST_SUITE(scheduler_tests) -static void microTask(CScheduler& s, boost::mutex& mutex, int& counter, int delta, std::chrono::system_clock::time_point rescheduleTime) +static void microTask(CScheduler& s, std::mutex& mutex, int& counter, int delta, std::chrono::system_clock::time_point rescheduleTime) { { - boost::unique_lock<boost::mutex> lock(mutex); + std::lock_guard<std::mutex> lock(mutex); counter += delta; } std::chrono::system_clock::time_point noTime = std::chrono::system_clock::time_point::min(); @@ -38,7 +40,7 @@ BOOST_AUTO_TEST_CASE(manythreads) // counters should sum to the number of initial tasks performed. CScheduler microTasks; - boost::mutex counterMutex[10]; + std::mutex counterMutex[10]; int counter[10] = { 0 }; FastRandomContext rng{/* fDeterministic */ true}; auto zeroToNine = [](FastRandomContext& rc) -> int { return rc.randrange(10); }; // [0, 9] |