util: Remove unused MilliSleep

This commit is contained in:
MarcoFalke
2020-02-21 09:48:27 -08:00
parent fa9af06d91
commit fae86c38bc
5 changed files with 2 additions and 91 deletions

View File

@@ -4,6 +4,7 @@
#include <random.h>
#include <scheduler.h>
#include <util/time.h>
#include <boost/thread.hpp>
#include <boost/test/unit_test.hpp>
@@ -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, &microTasks));
MicroSleep(600);
UninterruptibleSleep(std::chrono::microseconds{600});
now = boost::chrono::system_clock::now();
// More threads and more tasks: