From 783166348f06a34c195c6f77ad9389cf6a50da48 Mon Sep 17 00:00:00 2001 From: jphnix Date: Wed, 31 Jan 2024 05:46:09 +0000 Subject: [PATCH] Move protected area by mutex - surface->post_interval is needed to be protected by mutex Change-Id: I8f70ccb15e38fcfc24f2a4d326eeea6003eba9e8 --- src/tpl_wl_vk_thread.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.7.4