GMainContext *ctx;
int ret;
- ctx = g_main_context_default();
+ //TIZEN_ONLY(220322): Use thread default context
+ /* If a process sets the thread default context using the g_main_context_push_thread_default(),
+ * this function uses thread default context instead of the global default context.
+ */
+ ctx = g_main_context_get_thread_default();
+ if (!ctx)
+ ctx = g_main_context_default();
while (!g_main_context_acquire(ctx))
g_thread_yield();
#else
if (!pd->do_quit)
{
- if (!ecore_main_loop)
- ecore_main_loop = g_main_loop_new(NULL, FALSE);
+ //TIZEN_ONLY(220322): Use thread default context
+ /* If a process sets the thread default context using the g_main_context_push_thread_default(),
+ * this function uses thread default context instead of the global default context.
+ */
+ if (!ecore_main_loop) {
+ ecore_main_loop = g_main_loop_new(
+ g_main_context_get_thread_default(), FALSE);
+ }
g_main_loop_run(ecore_main_loop);
}
pd->do_quit = 0;
#else
if (!pd->do_quit)
{
- if (!ecore_main_loop)
- ecore_main_loop = g_main_loop_new(NULL, 1);
+ //TIZEN_ONLY(220322): Use thread default context
+ /* If a process sets the thread default context using the g_main_context_push_thread_default(),
+ * this function uses thread default context instead of the global default context.
+ */
+ if (!ecore_main_loop) {
+ ecore_main_loop = g_main_loop_new(
+ g_main_context_get_thread_default(), 1);
+ }
g_main_loop_run(ecore_main_loop);
}
pd->do_quit = 0;