From b56d3a571c53f6d617a3b33bcf22289d2ef92b47 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 19 Apr 2017 17:56:18 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Fixed a deadlock issue in case of destroying display source. Change-Id: Id622900535bc981952ef60b01328bd8e72bcdbd0 Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index c893f94..ad3c53f 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -135,7 +135,7 @@ _twe_thread_wl_disp_finalize(GSource *source) { twe_wl_disp_source *wl_source = (twe_wl_disp_source *)source; - wl_display_dispatch_queue(wl_source->disp, wl_source->ev_queue); + wl_display_dispatch_queue_pending(wl_source->disp, wl_source->ev_queue); wl_event_queue_destroy(wl_source->ev_queue); return; @@ -177,7 +177,7 @@ twe_thread_del_wl_display(twe_thread* thread, struct wl_display *display) source = (twe_wl_disp_source *)g_main_context_find_source_by_user_data( g_main_loop_get_context(thread->ctx->twe_loop), display); if (!source) { - TPL_ERROR("Failed to get source from context."); + TPL_ERR("Failed to get source from context."); return; } @@ -199,8 +199,8 @@ _twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer date) s = read(wl_surf_source->event_fd, &u, sizeof(uint64_t)); if (s != sizeof(uint64_t)) - TPL_ERROR("Failed to read from event_fd(%d)\n", - wl_surf_source->event_fd); + TPL_ERR("Failed to read from event_fd(%d)\n", + wl_surf_source->event_fd); } return G_SOURCE_CONTINUE; @@ -238,14 +238,14 @@ twe_thread_add_wl_surface(twe_thread* thread, source = (twe_wl_surf_source *)g_source_new(&_twe_wl_surface_funcs, sizeof(twe_wl_surf_source)); if (!source) { - TPL_ERROR("[THREAD] Failed to create GSource from event_channel(%p)", - event_channel); + TPL_ERR("[THREAD] Failed to create GSource from event_channel(%p)", + event_channel); return -1; } source->event_fd = eventfd(0, EFD_CLOEXEC); if (source->event_fd < 0) { - TPL_ERROR("[THREAD] Failed to create eventfd. errno(%d)", errno); + TPL_ERR("[THREAD] Failed to create eventfd. errno(%d)", errno); g_source_unref(&source->gsource); return -1; } @@ -272,7 +272,7 @@ twe_thread_del_wl_surface(twe_thread* thread, struct wl_surface *surface) source = (twe_wl_surf_source *) g_main_context_find_source_by_user_data( g_main_loop_get_context(ctx->twe_loop), surface); if (!source) { - TPL_ERROR("[THREAD] Failed to get source from context."); + TPL_ERR("[THREAD] Failed to get source from context."); return; } -- 2.7.4