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.
This commit is contained in:
Matthieu Gautier 2019-04-17 15:44:14 +00:00
parent 9321c589c8
commit fe682f855a
1 changed files with 3 additions and 3 deletions

View File

@ -3,8 +3,7 @@
#include "aria2.h"
#include "xmlrpc.h"
#include <sstream>
#include <thread>
#include <chrono>
#include <time.h>
#include <tools/otherTools.h>
#include <tools/pathTools.h>
#include <downloader.h> // 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;