mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 16:17:28 -04:00
replaced usleep() by rstime::rs_usleep() which accepts times >= 1 sec. Should fix problems on windows
This commit is contained in:
parent
c1fccef53b
commit
d0039241d3
28 changed files with 134 additions and 100 deletions
|
@ -40,6 +40,7 @@
|
|||
#endif
|
||||
#include "util/rsdiscspace.h"
|
||||
#include "util/rsmemory.h"
|
||||
#include "util/rstime.h"
|
||||
|
||||
#include "ft/ftcontroller.h"
|
||||
|
||||
|
@ -219,7 +220,7 @@ void ftController::data_tick()
|
|||
/* check the queues */
|
||||
|
||||
//Waiting 1 sec before start
|
||||
usleep(1*1000*1000); // 1 sec
|
||||
rstime::rs_usleep(1*1000*1000); // 1 sec
|
||||
|
||||
#ifdef CONTROL_DEBUG
|
||||
//std::cerr << "ftController::run()";
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "ft/ftextralist.h"
|
||||
#include "rsitems/rsconfigitems.h"
|
||||
#include "util/rsdir.h"
|
||||
#include "util/rstime.h"
|
||||
#include <stdio.h>
|
||||
#include <unistd.h> /* for (u)sleep() */
|
||||
#include <time.h>
|
||||
|
@ -64,12 +65,8 @@ void ftExtraList::data_tick()
|
|||
/* Hash a file */
|
||||
hashAFile();
|
||||
|
||||
#ifdef WIN32
|
||||
Sleep(1);
|
||||
#else
|
||||
/* microsleep */
|
||||
usleep(10);
|
||||
#endif
|
||||
rstime::rs_usleep(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -513,16 +510,7 @@ bool ftExtraList::loadList(std::list<RsItem *>& load)
|
|||
delete (*it);
|
||||
|
||||
/* short sleep */
|
||||
#ifndef WINDOWS_SYS
|
||||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||
usleep(1000); /* 1000 per second */
|
||||
|
||||
#else
|
||||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||
Sleep(1);
|
||||
#endif
|
||||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||
|
||||
rstime::rs_usleep(1000) ;
|
||||
}
|
||||
load.clear() ;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue