From fe682f855a75c031060d387b7758e676014bdce3 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 17 Apr 2019 15:44:14 +0000 Subject: [PATCH] Do not use this_thread::sleep. Mingw doesn't implement it. So, we should not use it. I suppose that it was working before because mingw package for debian trusty simply no provides a "thread" header. We may face to include the native "thread" header. --- src/aria2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aria2.cpp b/src/aria2.cpp index 06a3b9611..8074967aa 100644 --- a/src/aria2.cpp +++ b/src/aria2.cpp @@ -3,8 +3,7 @@ #include "aria2.h" #include "xmlrpc.h" #include -#include -#include +#include #include #include #include // For AriaError @@ -82,7 +81,8 @@ Aria2::Aria2(): int watchdog = 50; while(--watchdog) { - std::this_thread::sleep_for(std::chrono::microseconds(10000)); + struct timespec wait = {0, 10000000}; + nanosleep(&wait, nullptr); auto res = curl_easy_perform(mp_curl); if (res == CURLE_OK) { break;