remove calls to cpp11::sleep_for()

This commit is contained in:
Maxime Gimeno 2021-05-07 11:13:03 +02:00
parent 3e03d50b8a
commit 33cefe1be7
3 changed files with 9 additions and 3 deletions

View File

@ -168,7 +168,9 @@ public:
*m_interrupted = true;
if (*m_interrupted)
return;
cpp11::sleep_for (0.00001);
typedef std::chrono::nanoseconds nanoseconds;
nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.00001));
std::this_thread::sleep_for(ns);
}
if (m_callback)
m_callback (1.);

View File

@ -302,7 +302,9 @@ bool push_file(ssh_session &session,
//some versions of libssh don't copy everything without this.
//This is the case for the official version on Ubuntu 18.04
std::chrono::duration<int, std::micro> timespan(size);
std::this_thread::sleep_for(timespan);
typedef std::chrono::nanoseconds nanoseconds;
nanoseconds ns (nanoseconds::rep (1000000000.0 * timespan));
std::this_thread::sleep_for(ns);
if (res != SSH_OK)
{
std::cerr<< "Can't write to remote file: %s\n"

View File

@ -118,7 +118,9 @@ void run_with_qprogressdialog (Functor& functor,
while (*signal_callback->latest_adv != 1. &&
*signal_callback->state)
{
CGAL::cpp11::sleep_for (0.1);
typedef std::chrono::nanoseconds nanoseconds;
nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.1));
std::this_thread::sleep_for(ns);
QApplication::processEvents ();
}