From a2e1ab6fe7e2a4463c452579f2a6522945a7bc25 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 20 Apr 2020 16:52:07 +0900 Subject: [PATCH] Excluded the case of abort due to eventfd problem. - Remove poll fd(event_fd) of main loop, but keep gsource. Change-Id: I3759d24672895b355e3541e7b8b6d2a2de7dab6d Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 121a1da..2742986 100755 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -268,9 +268,11 @@ _twe_thread_del_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) } else { TPL_ERR("eventfd(%d) cannot wake up with other condition. cond(%d)", del_source->event_fd, cond); - g_cond_signal(&_twe_ctx->thread_cond); - g_mutex_unlock(&_twe_ctx->thread_mutex); - TPL_ASSERT((cond & G_IO_IN)); + + g_source_remove_unix_fd(del_source->event_fd, del_source->tag); + close(del_source->event_fd); + del_source->tag = NULL; + del_source->event_fd = -1; } g_cond_signal(&_twe_ctx->thread_cond); @@ -2346,7 +2348,10 @@ _twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer data) } else { TPL_ERR("eventfd(%d) cannot wake up with other condition. cond(%d)", surf_source->event_fd, cond); - TPL_ASSERT((cond & G_IO_IN)); + g_source_remove_unix_fd(source, surf_source->tag); + close(surf_source->event_fd); + surf_source->tag = NULL; + surf_source->event_fd = -1; } g_mutex_unlock(&surf_source->surf_mutex); -- 2.7.4