From fae86c38bca5c960462e53975314a0749db5d17d Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 21 Feb 2020 09:48:27 -0800 Subject: util: Remove unused MilliSleep --- src/test/scheduler_tests.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/test') diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index a6cb34cf28..058dd1deda 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -23,18 +24,6 @@ static void microTask(CScheduler& s, boost::mutex& mutex, int& counter, int delt } } -static void MicroSleep(uint64_t n) -{ -#if defined(HAVE_WORKING_BOOST_SLEEP_FOR) - boost::this_thread::sleep_for(boost::chrono::microseconds(n)); -#elif defined(HAVE_WORKING_BOOST_SLEEP) - boost::this_thread::sleep(boost::posix_time::microseconds(n)); -#else - //should never get here - #error missing boost sleep implementation -#endif -} - BOOST_AUTO_TEST_CASE(manythreads) { // Stress test: hundreds of microsecond-scheduled tasks, @@ -81,7 +70,7 @@ BOOST_AUTO_TEST_CASE(manythreads) for (int i = 0; i < 5; i++) microThreads.create_thread(std::bind(&CScheduler::serviceQueue, µTasks)); - MicroSleep(600); + UninterruptibleSleep(std::chrono::microseconds{600}); now = boost::chrono::system_clock::now(); // More threads and more tasks: -- cgit v1.2.3