From: Gukhwan Cho Date: Thu, 20 Aug 2015 12:20:51 +0000 (+0900) Subject: mutex unlock during sockt_send X-Git-Tag: accepted/tizen/ivi/20160218.024019~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F47097%2F2;p=platform%2Fcore%2Fpim%2Fpims-ipc.git mutex unlock during sockt_send Change-Id: I3d6426304d92769dadb35e9f7d11d4bd6e45456a Signed-off-by: Gukhwan Cho --- diff --git a/src/pims-ipc-svc.c b/src/pims-ipc-svc.c index 8c04ed3..9c74fd5 100644 --- a/src/pims-ipc-svc.c +++ b/src/pims-ipc-svc.c @@ -424,6 +424,7 @@ API int pims_ipc_svc_publish(char *module, char *event, pims_ipc_data_h data) int ret = 0; while(cursor) { int fd = (int)cursor->data; + pthread_mutex_unlock(&ipc_svc->subscribe_fds_mutex); ret = socket_send(fd, buf, length); if (ret < 0) { ERROR("socket_send publish error : %d", ret); @@ -435,6 +436,7 @@ API int pims_ipc_svc_publish(char *module, char *event, pims_ipc_data_h data) ERROR("socket_send_data publish error : %d", ret); } } + pthread_mutex_lock(&ipc_svc->subscribe_fds_mutex); cursor = g_list_next(cursor); } pthread_mutex_unlock(&ipc_svc->subscribe_fds_mutex); diff --git a/src/pims-socket.c b/src/pims-socket.c index 2870a81..6530945 100644 --- a/src/pims-socket.c +++ b/src/pims-socket.c @@ -44,12 +44,18 @@ int socket_send(int fd, char *buf, int len) while (length > 0) { passed_len = send(fd, (const void *)buf, length, MSG_NOSIGNAL); if (passed_len == -1) { - if (errno == EINTR) + if (errno == EINTR){ + ERROR("EINTR error. send retry"); continue; - else if (errno == EAGAIN) + } + else if (errno == EAGAIN) { + ERROR("EAGAIN error. send retry"); continue; - else if (errno == EWOULDBLOCK) + } + else if (errno == EWOULDBLOCK) { + ERROR("EWOULDBLOCK error. send retry"); continue; + } ERROR("send error [%d]", errno); break; } else if (passed_len == 0)