mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #219 from kiwix/fix_sleep_windows
Revert Do not use this_thread::sleep.
This commit is contained in:
commit
8698407e1e
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue