From 33cefe1be7db67010610aa3d35b68c92c5738d77 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 7 May 2021 11:13:03 +0200 Subject: [PATCH] remove calls to cpp11::sleep_for() --- .../CGAL/Point_set_processing_3/internal/Callback_wrapper.h | 4 +++- Polyhedron/demo/Polyhedron/Use_ssh.cpp | 4 +++- Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h index 266a7bcd306..bd20e2505ec 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h @@ -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.); diff --git a/Polyhedron/demo/Polyhedron/Use_ssh.cpp b/Polyhedron/demo/Polyhedron/Use_ssh.cpp index 0b3d93db7b7..f6e63991b1d 100644 --- a/Polyhedron/demo/Polyhedron/Use_ssh.cpp +++ b/Polyhedron/demo/Polyhedron/Use_ssh.cpp @@ -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 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" diff --git a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h index 42345fb335a..f2657fda3f1 100644 --- a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h +++ b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h @@ -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 (); }