From: jphnix Date: Wed, 31 Jan 2024 05:46:09 +0000 (+0000) Subject: Move protected area by mutex X-Git-Tag: accepted/tizen/unified/20240219.160350~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F305301%2F4;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Move protected area by mutex - surface->post_interval is needed to be protected by mutex Change-Id: I8f70ccb15e38fcfc24f2a4d326eeea6003eba9e8 --- diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index a5b4bc0..9c96a3e 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -1452,22 +1452,23 @@ static tpl_result_t __tpl_wl_vk_surface_set_post_interval(tpl_surface_t *surface, int post_interval) { - tpl_wl_vk_surface_t *wl_vk_surface = NULL; - TPL_CHECK_ON_NULL_RETURN_VAL(surface, TPL_ERROR_INVALID_PARAMETER); - wl_vk_surface = (tpl_wl_vk_surface_t *)surface->backend.data; + tpl_wl_vk_surface_t *wl_vk_surface = (tpl_wl_vk_surface_t *)surface->backend.data; TPL_CHECK_ON_NULL_RETURN_VAL(wl_vk_surface, TPL_ERROR_INVALID_PARAMETER); + tpl_gmutex_lock(&wl_vk_surface->surf_mutex); + TPL_INFO("[SET_POST_INTERVAL]", "wl_vk_surface(%p) post_interval(%d -> %d)", wl_vk_surface, wl_vk_surface->post_interval, post_interval); - tpl_gmutex_lock(&wl_vk_surface->surf_mutex); wl_vk_surface->post_interval = post_interval; tpl_gmutex_unlock(&wl_vk_surface->surf_mutex); + + return TPL_ERROR_NONE; }