Merge pull request #219 from kiwix/fix_sleep_windows

Revert Do not use this_thread::sleep.
This commit is contained in:
Matthieu Gautier 2019-05-03 15:54:49 +02:00 committed by GitHub
commit 8698407e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,8 @@
#include "aria2.h" #include "aria2.h"
#include "xmlrpc.h" #include "xmlrpc.h"
#include <sstream> #include <sstream>
#include <time.h> #include <thread>
#include <chrono>
#include <tools/otherTools.h> #include <tools/otherTools.h>
#include <tools/pathTools.h> #include <tools/pathTools.h>
#include <downloader.h> // For AriaError #include <downloader.h> // For AriaError
@ -81,8 +82,7 @@ Aria2::Aria2():
int watchdog = 50; int watchdog = 50;
while(--watchdog) { while(--watchdog) {
struct timespec wait = {0, 10000000}; sleep(10);
nanosleep(&wait, nullptr);
auto res = curl_easy_perform(mp_curl); auto res = curl_easy_perform(mp_curl);
if (res == CURLE_OK) { if (res == CURLE_OK) {
break; break;