Move protected area by mutex
[platform/core/uifw/libtpl-egl.git] / src / tpl_wl_vk_thread.c
index a5b4bc0..9c96a3e 100644 (file)
@@ -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;
 }