[DEV] remove dependency of unistd.h
This commit is contained in:
parent
c6a592592a
commit
090c280e34
@ -11,7 +11,7 @@
|
||||
#include <etk/etk.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <etk/os/FSNode.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <etk/stdTools.hpp>
|
||||
|
||||
@ -194,7 +194,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
}
|
||||
int32_t iii=0;
|
||||
while (iii < 3) {
|
||||
usleep(500000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
APPL_INFO("Appl in waiting ... " << iii << "/3");
|
||||
iii++;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <zeus/Service.hpp>
|
||||
#include <etk/etk.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <etk/stdTools.hpp>
|
||||
namespace appl {
|
||||
@ -105,7 +105,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
serviceInterface.connect();
|
||||
int32_t iii=0;
|
||||
while (true) {
|
||||
usleep(1000000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
serviceInterface.pingIsAlive();
|
||||
APPL_INFO("service in waiting ... " << iii << "/inf");
|
||||
iii++;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <zeus/File.hpp>
|
||||
#include <etk/etk.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <ejson/ejson.hpp>
|
||||
#include <etk/os/FSNode.hpp>
|
||||
@ -430,12 +430,12 @@ int main(int _argc, const char *_argv[]) {
|
||||
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
||||
APPL_INFO("===========================================================");
|
||||
APPL_INFO("wait 5 second ...");
|
||||
usleep(5000000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
continue;
|
||||
}
|
||||
int32_t iii=0;
|
||||
while (serviceInterface.GateWayAlive() == true) {
|
||||
usleep(1000000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
serviceInterface.pingIsAlive();
|
||||
/*
|
||||
serviceInterface.store();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <appl/ClientInterface.hpp>
|
||||
#include <zeus/Future.hpp>
|
||||
#include <appl/GateWay.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <zeus/AbstractFunction.hpp>
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <appl/GateWay.hpp>
|
||||
#include <etk/etk.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <etk/stdTools.hpp>
|
||||
|
||||
@ -48,7 +48,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
APPL_INFO("==================================");
|
||||
basicGateway.start();
|
||||
while (true) {
|
||||
usleep(100000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
basicGateway.cleanIO();
|
||||
}
|
||||
basicGateway.stop();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <zeus/Service.hpp>
|
||||
#include <etk/etk.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <ejson/ejson.hpp>
|
||||
|
||||
@ -244,12 +244,12 @@ int main(int _argc, const char *_argv[]) {
|
||||
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
||||
APPL_INFO("===========================================================");
|
||||
APPL_INFO("wait 5 second ...");
|
||||
usleep(5000000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
continue;
|
||||
}
|
||||
int32_t iii=0;
|
||||
while (serviceInterface.GateWayAlive() == true) {
|
||||
usleep(1000000);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
serviceInterface.pingIsAlive();
|
||||
APPL_INFO("service in waiting ... " << iii << "/inf");
|
||||
iii++;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <zeus/Client.hpp>
|
||||
#include <zeus/debug.hpp>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
zeus::Client::Client() :
|
||||
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Client::onPropertyChangeIp),
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <eproperty/Value.hpp>
|
||||
#include <zeus/debug.hpp>
|
||||
#include <chrono>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <zeus/Future.hpp>
|
||||
#include <zeus/ServiceRemote.hpp>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <zeus/Future.hpp>
|
||||
#include <zeus/BufferAnswer.hpp>
|
||||
#include <zeus/debug.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <zeus/File.hpp>
|
||||
|
||||
namespace zeus {
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <zeus/FutureBase.hpp>
|
||||
#include <zeus/BufferAnswer.hpp>
|
||||
#include <zeus/debug.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
zeus::FutureBase::FutureBase(const zeus::FutureBase& _base):
|
||||
m_data(_base.m_data) {
|
||||
@ -172,7 +172,7 @@ bool zeus::FutureBase::isFinished() const {
|
||||
const zeus::FutureBase& zeus::FutureBase::wait() const {
|
||||
while (isFinished() == false) {
|
||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||
usleep(10000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -182,7 +182,7 @@ const zeus::FutureBase& zeus::FutureBase::waitFor(std::chrono::microseconds _del
|
||||
while ( std::chrono::steady_clock::now() - start < _delta
|
||||
&& isFinished() == false) {
|
||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||
usleep(10000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
start = std::chrono::steady_clock::now();
|
||||
}
|
||||
return *this;
|
||||
@ -192,7 +192,7 @@ const zeus::FutureBase& zeus::FutureBase::waitUntil(std::chrono::steady_clock::t
|
||||
while ( std::chrono::steady_clock::now() < _endTime
|
||||
&& isFinished() == false) {
|
||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||
usleep(10000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <etk/stdTools.hpp>
|
||||
#include <enet/TcpClient.hpp>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
zeus::Service::Service() :
|
||||
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Service::onPropertyChangeIp),
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <zeus/WebServer.hpp>
|
||||
#include <zeus/debug.hpp>
|
||||
#include <ethread/tools.hpp>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <zeus/BufferData.hpp>
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ void zeus::WebServer::connect(bool _async){
|
||||
while ( _async == false
|
||||
&& m_threadAsyncRunning == true
|
||||
&& m_connection.isAlive() != true) {
|
||||
usleep(50000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
//ethread::setPriority(*m_receiveThread, -6);
|
||||
if (_async == true) {
|
||||
@ -281,7 +281,7 @@ void zeus::WebServer::threadAsyncCallback() {
|
||||
m_threadAsyncList2.clear();
|
||||
}
|
||||
if (m_threadAsyncList.size() == 0) {
|
||||
usleep(10000);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
continue;
|
||||
}
|
||||
auto it = m_threadAsyncList.begin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user