Excluded the case of abort due to eventfd problem. 35/231435/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 20 Apr 2020 07:52:07 +0000 (16:52 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Mon, 20 Apr 2020 07:55:32 +0000 (16:55 +0900)
 - Remove poll fd(event_fd) of main loop, but keep gsource.

Change-Id: I3759d24672895b355e3541e7b8b6d2a2de7dab6d
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index 121a1da..2742986 100755 (executable)
@@ -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);