Check the value at idle time for debugging the cpu usage issue
[platform/core/multimedia/mmsvc-core.git] / server / src / muse_server_connection.c
index 20dede2..8f995cf 100644 (file)
@@ -144,6 +144,9 @@ int ms_connection_unregister(muse_module_h m)
 
        _ms_connection_module_instance_info(m, connection, queue, API_DESTROY);
 
+       LOGI("[%d] g_cond_signal", fd);
+       g_cond_signal(&connection->cond);
+
        ms_connection_unlock(connection);
 
        LOGD("Leave");
@@ -151,7 +154,7 @@ int ms_connection_unregister(muse_module_h m)
        return MM_ERROR_NONE;
 }
 
-gboolean ms_connection_get_state(ms_connection_state_e *state)
+gboolean ms_connection_get_state(ms_connection_state_e *state, int *out_fd)
 {
        int idx, fd, ep_fd, fd_count, errsv;
        struct epoll_event *p_event;
@@ -160,6 +163,7 @@ gboolean ms_connection_get_state(ms_connection_state_e *state)
        ms_connection_t *connection = NULL;
 
        muse_return_val_if_fail(ms_get_instance(), MM_ERROR_UNKNOWN);
+       muse_return_val_if_fail(out_fd, MM_ERROR_INVALID_ARGUMENT);
 
        connection = ms_get_instance()->connection;
 
@@ -211,6 +215,7 @@ gboolean ms_connection_get_state(ms_connection_state_e *state)
                        }
                        *state = MUSE_CONNECTION_STATE_DISCONNECTED;
                }
+               *out_fd = fd;
        }
 
        return TRUE;