sensord: sleep 100ms instead of a very short time 53/126053/2
authorkibak.yoon <kibak.yoon@samsung.com>
Thu, 20 Apr 2017 03:56:49 +0000 (12:56 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Thu, 20 Apr 2017 04:51:51 +0000 (13:51 +0900)
Change-Id: Ib6432a072cb59bf03803915c497916695993a340
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/shared/stream_socket.cpp

index cdf8ccc..0191f05 100644 (file)
@@ -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;
                        }