From: kibak.yoon Date: Thu, 20 Apr 2017 03:56:49 +0000 (+0900) Subject: sensord: sleep 100ms instead of a very short time X-Git-Tag: accepted/tizen/unified/20170420.155849^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86712a3de5b433121bdc457929015746b47d90d8;p=platform%2Fcore%2Fsystem%2Fsensord.git sensord: sleep 100ms instead of a very short time Change-Id: Ib6432a072cb59bf03803915c497916695993a340 Signed-off-by: kibak.yoon --- 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; }