From 86712a3de5b433121bdc457929015746b47d90d8 Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Thu, 20 Apr 2017 12:56:49 +0900 Subject: [PATCH] sensord: sleep 100ms instead of a very short time Change-Id: Ib6432a072cb59bf03803915c497916695993a340 Signed-off-by: kibak.yoon --- src/shared/stream_socket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/stream_socket.cpp b/src/shared/stream_socket.cpp index cdf8ccc..0191f05 100644 --- a/src/shared/stream_socket.cpp +++ b/src/shared/stream_socket.cpp @@ -24,6 +24,8 @@ #include "sensor_log.h" +#define SLEEP_100_MS usleep(100000) + using namespace ipc; stream_socket::stream_socket() @@ -52,7 +54,7 @@ ssize_t stream_socket::on_send(const void *buffer, size_t size) const if (len < 0) { if ((errno == EINTR) || (errno == EAGAIN) || (errno == EWOULDBLOCK)) { - usleep(1); + SLEEP_100_MS; continue; } @@ -86,7 +88,7 @@ ssize_t stream_socket::on_recv(void *buffer, size_t size) const if (len < 0) { if ((errno == EINTR) || (errno == EAGAIN) || (errno == EWOULDBLOCK)) { - usleep(10000); + SLEEP_100_MS; continue; } -- 2.7.4