From: Joonbum Ko Date: Mon, 27 Apr 2020 09:45:03 +0000 (+0900) Subject: Changed getenv() for TPL_WAIT_VBLANK to be called from main thread. X-Git-Tag: submit/tizen/20200507.060140~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aca218df76453a2484bd9e938e823063a04e1834;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Changed getenv() for TPL_WAIT_VBLANK to be called from main thread. Change-Id: I9e5143492d35ed7e6c1722af3c0b7888ff918aa8 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index f815193..79bcb91 100755 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -42,6 +42,7 @@ struct _twe_thread_context { int ref_cnt; + tpl_bool_t use_wait_vblank; twe_tdm_source *tdm_source; twe_del_source *tdm_del_source; @@ -216,12 +217,9 @@ _twe_thread_loop(gpointer data) { twe_thread_context *ctx = data; - char *env = NULL; - g_mutex_lock(&ctx->thread_mutex); - env = getenv("TPL_WAIT_VBLANK"); - if (env == NULL || atoi(env)) { + if (ctx->use_wait_vblank) { twe_tdm_source *tdm_source = _twe_thread_tdm_source_create(); if (tdm_source) { @@ -506,6 +504,7 @@ twe_thread* twe_thread_create(void) { twe_thread *thread = NULL; + char *env = NULL; thread = calloc(1, sizeof(twe_thread)); if (!thread) { @@ -531,6 +530,13 @@ twe_thread_create(void) g_mutex_init(&_twe_ctx->thread_mutex); g_cond_init(&_twe_ctx->thread_cond); + _twe_ctx->use_wait_vblank = TPL_TRUE; + + env = getenv("TPL_WAIT_VBLANK"); + if (env && !atoi(env)) { + _twe_ctx->use_wait_vblank = TPL_FALSE; + } + g_mutex_lock(&_twe_ctx->thread_mutex); _twe_ctx->twe_thread = g_thread_new("twe_thread", _twe_thread_loop, _twe_ctx);