struct sigaction muse_client_segv_old_action;
struct sigaction muse_client_term_old_action;
struct sigaction muse_client_sys_old_action;
-static void _muse_client_sigaction(int signo, siginfo_t *siginfo, void *context);
-static void _muse_client_constructor() __attribute__((constructor));
GMutex g_muse_client_mutex;
GHashTable *g_muse_client_table;
const char *UDS_files[MUSE_CHANNEL_MAX] = {MUSE_SOCK_FILE0, MUSE_SOCK_FILE1};
+static void _muse_client_sigaction(int signo, siginfo_t *siginfo, void *context);
+static void _muse_client_constructor(void) __attribute__((constructor));
static int _muse_client_new(muse_channel_e channel);
static void _muse_client_table_new(void);
static gpointer _muse_client_get_fd_ptr(int sock_fd);
static gboolean _muse_client_table_remove_func(gpointer key, gpointer value, gpointer user_data);
-
static gboolean _muse_client_table_remove_func(gpointer key, gpointer value, gpointer user_data)
{
int sock_fd = GPOINTER_TO_INT(key);
/* close all opened fds */
g_mutex_lock(&g_muse_client_mutex);
- g_hash_table_foreach_remove(g_muse_client_table,
- _muse_client_table_remove_func,
- NULL);
+ g_hash_table_foreach_remove(g_muse_client_table, _muse_client_table_remove_func, NULL);
g_mutex_unlock(&g_muse_client_mutex);
return;
}
-
-static void _muse_client_constructor()
+static void _muse_client_constructor(void)
{
struct sigaction muse_client_action;
muse_client_action.sa_sigaction = _muse_client_sigaction;
return;
}
-
static int _muse_client_new(muse_channel_e channel)
{
struct sockaddr_un address;
if (server->state != MUSE_SERVER_STATE_READY) {
LOGW("Now mused state is not ready...");
- muse_server_main_thread_unlock();
+ muse_server_state_unlock();
return FALSE;
}
if (g_queue_is_empty(muse_server_ipc_get_instance()->module_queue) && server->state != MUSE_SERVER_STATE_IDLE) {
if (used_pss_mb > muse_server_config_get_instance()->memory_threshold) {
+ muse_server_state_lock();
+ server->state = MUSE_SERVER_STATE_IDLE;
+ muse_server_state_unlock();
+
muse_server_log_process_info(pid);
snprintf(err_msg, sizeof(err_msg), "[Memory Leak] %d > %d",