From 2cde2c02ca0e2bf1dc6f8fa78cd830f5989f9cea Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Sun, 12 Feb 2017 17:53:13 -0500 Subject: switch to boost::thread for mingw build --- tests/unit_tests/epee_boosted_tcp_server.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'tests/unit_tests/epee_boosted_tcp_server.cpp') diff --git a/tests/unit_tests/epee_boosted_tcp_server.cpp b/tests/unit_tests/epee_boosted_tcp_server.cpp index 946db292d..261d81f84 100644 --- a/tests/unit_tests/epee_boosted_tcp_server.cpp +++ b/tests/unit_tests/epee_boosted_tcp_server.cpp @@ -28,10 +28,9 @@ // // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -#include -#include -#include -#include +#include +#include +#include #include "gtest/gtest.h" @@ -88,13 +87,13 @@ TEST(boosted_tcp_server, worker_threads_are_exception_resistant) test_tcp_server srv(epee::net_utils::e_connection_type_RPC); // RPC disables network limit for unit tests ASSERT_TRUE(srv.init_server(test_server_port, test_server_host)); - std::mutex mtx; - std::condition_variable cond; + boost::mutex mtx; + boost::condition_variable cond; int counter = 0; auto counter_incrementer = [&counter, &cond, &mtx]() { - std::unique_lock lock(mtx); + boost::unique_lock lock(mtx); ++counter; if (4 <= counter) { @@ -110,8 +109,8 @@ TEST(boosted_tcp_server, worker_threads_are_exception_resistant) ASSERT_TRUE(srv.async_call([&counter_incrementer]() { counter_incrementer(); throw 4; })); { - std::unique_lock lock(mtx); - ASSERT_NE(std::cv_status::timeout, cond.wait_for(lock, std::chrono::seconds(5))); + boost::unique_lock lock(mtx); + ASSERT_NE(boost::cv_status::timeout, cond.wait_for(lock, boost::chrono::seconds(5))); ASSERT_EQ(4, counter); } @@ -124,8 +123,8 @@ TEST(boosted_tcp_server, worker_threads_are_exception_resistant) ASSERT_TRUE(srv.async_call(counter_incrementer)); { - std::unique_lock lock(mtx); - ASSERT_NE(std::cv_status::timeout, cond.wait_for(lock, std::chrono::seconds(5))); + boost::unique_lock lock(mtx); + ASSERT_NE(boost::cv_status::timeout, cond.wait_for(lock, boost::chrono::seconds(5))); ASSERT_EQ(4, counter); } -- cgit v1.2.3