From: InHong Han Date: Mon, 9 Apr 2018 10:52:31 +0000 (+0900) Subject: Fixed the deadlock issue X-Git-Tag: accepted/tizen/unified/20180416.213746~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a3dd0b76cb293e3ab00592ee6886fae89360a0a;p=platform%2Fcore%2Fuifw%2Fisf.git Fixed the deadlock issue The wl_display_roundtrip() uses the default queue of display. Calling wl_display_roundtrip() from other thread may cause deadlock issue because the done event has not been delivered. Change-Id: I0991e431d100d027680dbf2234fad77a1702d903 --- diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index ac6df2d..97a0f6b 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -3332,9 +3332,11 @@ wayland_im_context_filter_event(Ecore_IMF_Context *ctx, struct wl_display *display = NULL; if (wl2_display) display = ecore_wl2_display_get(wl2_display); + struct wl_event_queue *queue = wl_display_create_queue(display); - if (display) { - while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND && _focused_ctx == ctx && wl_display_roundtrip(display) != -1) { + if (display && queue) { + while (ecore_time_get() - start_time < WAIT_FOR_FILTER_DONE_SECOND && _focused_ctx == ctx && wl_display_roundtrip_queue(display, queue) != -1) { + wl_display_dispatch_pending(display); if (imcontext->last_key_event_filter.serial == serial) { ret = imcontext->last_key_event_filter.state; break; @@ -3342,6 +3344,9 @@ wayland_im_context_filter_event(Ecore_IMF_Context *ctx, break; } } + + if (queue) + wl_event_queue_destroy(queue); LOGD ("elapsed : %.3f ms, serial (last, require) : (%d, %d)", (ecore_time_get() - start_time)*1000, imcontext->last_key_event_filter.serial, serial); } while (0);