m = (muse_module_h)data;
fd = m->ch[MUSE_CHANNEL_MSG].sock_fd;
+ m->ch[MUSE_CHANNEL_MSG].thread = g_thread_self();
- LOGD("Enter %d modlue %p", fd, m);
+ LOGD("Enter %d module %p thread %p", fd, m, m->ch[MUSE_CHANNEL_MSG].thread);
while (attempt_to_dispatch) {
memset(m->recv_msg, 0x00, sizeof(m->recv_msg));
gboolean ms_ipc_create_msg_dispatch_worker(muse_module_h m)
{
+ GThread *thread = NULL;
GError *error = NULL;
muse_server_h ms = ms_get_instance();
SECURE_LOGD("[PID %d module %p] module's msg channel fd : %d", m->pid, m, m->ch[MUSE_CHANNEL_MSG].sock_fd);
- m->ch[MUSE_CHANNEL_MSG].thread = g_thread_try_new(MSG_THREAD_NAME, _ms_ipc_dispatch_worker, (gpointer)m, &error);
-
- if (!m->ch[MUSE_CHANNEL_MSG].thread) {
- LOGE("thread creation failed : %s", error->message);
+ thread = g_thread_try_new(MSG_THREAD_NAME, _ms_ipc_dispatch_worker, (gpointer)m, &error);
+ if (!thread) {
+ LOGE("[module %p] thread creation failed : %s", m, error->message);
g_error_free(error);
ms_log_process_info(ms->pid);
+ return FALSE;
}
- muse_return_val_if_fail(m->ch[MUSE_CHANNEL_MSG].thread, FALSE);
+ LOGD("Leave module %p, thread %p", m, thread);
- LOGD("Leave");
return TRUE;
}