Change-Id: Ia9fffe62c90d596efe29929c50e835d4a93fac52
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
return FALSE;
}
+static gboolean
+_g_kdbus_thread_end (gpointer thread)
+{
+ GThread *gthread = (GThread *)thread;
+
+ g_thread_join (gthread);
+
+ return FALSE;
+}
+
/*
* _g_kdbus_close
*/
g_main_loop_unref (worker->loop);
- g_thread_join (worker->thread);
+ if (g_thread_self() == worker->thread)
+ g_main_context_invoke (NULL, _g_kdbus_thread_end, worker->thread);
+ else
+ g_thread_join (worker->thread);
+
worker->thread = NULL;
close (worker->fd);
return TRUE;
}
-
/*
* _g_kdbus_is_closed
*/