From: Wonkeun Oh Date: Fri, 24 Feb 2017 01:36:27 +0000 (+0900) Subject: Fixed the deadlock issue. X-Git-Tag: accepted/tizen/common/20170228.065214~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6686cd423934863fae2f6b5537a0be40e3a9100;p=platform%2Fcore%2Fuifw%2Fisf.git Fixed the deadlock issue. If the default event queue is empty, the 'wl_display_dispatch' function blocks until there are events to be read from the display fd. So, it might cause the deadlock state of the application's process, If the event queue is empty continually because of some problem. As for the 'wl_display_roundtrip' function, This function blocks until the server has processed all currently issued requests by sending a request to the display server and waiting for a reply before returning. Plus, these functions return the -1 on failure such as closed connection case. It need to be checked Change-Id: If1e007196945422433d66bf47de58f1809f0535d --- diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index 15cbe68..a7c6a13 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -2953,9 +2953,7 @@ wayland_im_context_filter_event(Ecore_IMF_Context *ctx, //This function should return IME filtering result with boolean type. struct wl_display *display = ecore_wl_display_get(); if (display) { - while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND) { - wl_display_dispatch(display); - + while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND && wl_display_roundtrip(display) != -1) { if (imcontext->last_key_event_filter.serial == serial) { ret = imcontext->last_key_event_filter.state; break;