From: Joonbum Ko Date: Wed, 6 Jan 2021 06:46:31 +0000 (+0900) Subject: Added message argunment to thread dispatch callback. X-Git-Tag: submit/tizen/20210316.021228~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff64b35eaa30128d0c8eb80ce9fc8bf220ef8f0a;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Added message argunment to thread dispatch callback. Change-Id: I37c39032839c0e598006ed29ae31ea5ca1b66207 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index 6329ce9..8bfcb01 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -185,8 +185,19 @@ _thread_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) TPL_IGNORE(cb); if (cond & G_IO_IN) { + ssize_t s; + uint64_t message = 0; + + if (gsource->is_eventfd) { + s = read(gsource->fd, &message, sizeof(uint64_t)); + if (s != sizeof(uint64_t)) { + TPL_ERR("Failed to read from event_fd(%d)", + gsource->fd); + } + } + if (gsource->gsource_funcs && gsource->gsource_funcs->dispatch) - ret = gsource->gsource_funcs->dispatch(gsource); + ret = gsource->gsource_funcs->dispatch(gsource, message); if (gsource->type == SOURCE_TYPE_FINALIZER) { tpl_gsource *del_source = (tpl_gsource *)data; diff --git a/src/tpl_utils_gthread.h b/src/tpl_utils_gthread.h index d24ce8e..66ad277 100644 --- a/src/tpl_utils_gthread.h +++ b/src/tpl_utils_gthread.h @@ -30,7 +30,7 @@ typedef enum { struct _tpl_gsource_functions { tpl_bool_t (*prepare) (tpl_gsource *source); tpl_bool_t (*check) (tpl_gsource *source); - tpl_bool_t (*dispatch) (tpl_gsource *source); + tpl_bool_t (*dispatch) (tpl_gsource *source, uint64_t message); void (*finalize) (tpl_gsource *source); }; diff --git a/src/tpl_wl_egl.c b/src/tpl_wl_egl.c index c0e1416..3079519 100644 --- a/src/tpl_wl_egl.c +++ b/src/tpl_wl_egl.c @@ -203,11 +203,13 @@ _check_native_handle_is_wl_display(tpl_handle_t display) } static tpl_bool_t -__thread_func_tdm_dispatch(tpl_gsource *gsource) +__thread_func_tdm_dispatch(tpl_gsource *gsource, uint64_t message) { tpl_wl_egl_display_t *wl_egl_display = NULL; tdm_error tdm_err = TDM_ERROR_NONE; + TPL_IGNORE(message); + wl_egl_display = (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource); if (!wl_egl_display) { TPL_ERR("Failed to get wl_egl_display from gsource(%p)", gsource);