Fix thread unsafety issue and retrying prepare 27/188227/2 accepted/tizen/unified/20180903.151053 submit/tizen/20180903.093058
authorsooyeon.kim <sooyeon.kim@samsung.com>
Mon, 3 Sep 2018 07:14:34 +0000 (16:14 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Mon, 3 Sep 2018 07:57:28 +0000 (16:57 +0900)
- fix thread unsafety issue to avoid adding and deleting focus_cb in the different threads
- fix to retry connect_daemon when vc_dbus_initialize() is failed due to TIMED_OUT

Change-Id: I10ceff7d62b716c0e954c78406e0f6ec840a3f7a
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
client/vc.c

index 594c2ef5ca740da4e8232fd5ea207ff241901e60..df42efe41188d682ec34062fda22c3fe9c37fb32 100644 (file)
@@ -512,7 +512,7 @@ static Eina_Bool __vc_connect_daemon(void *data)
                        ecore_main_loop_thread_safe_call_async(__vc_notify_error, (void*)g_vc);
 
                        SLOG(LOG_DEBUG, TAG_VCC, "@@@");
-                       return EINA_FALSE;
+                       return EINA_TRUE;
                } else {
                        /* Success to connect */
                }
@@ -537,8 +537,10 @@ static Eina_Bool __vc_connect_daemon(void *data)
                }
 
                /* Register focus handler */
+               ecore_thread_main_loop_begin();
                g_focus_in_handler = ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN, __focus_changed_cb, NULL);
                g_focus_out_handler = ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT, __focus_changed_cb, NULL);
+               ecore_thread_main_loop_end();
 
                char appid[1024] = {'\0',};
                aul_app_get_appid_bypid(getpid(), appid, sizeof(appid) - 1);