Add missing pthread_mutex_unlock 16/257716/1 accepted/tizen/unified/20210502.124131 submit/tizen/20210430.042939
authorJoonbum Ko <joonbum.ko@samsung.com>
Fri, 30 Apr 2021 04:18:48 +0000 (13:18 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Fri, 30 Apr 2021 04:21:17 +0000 (13:21 +0900)
Change-Id: I082412adb77524469af5a436a386e54cce5f7449
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/wsi/swapchain_tdm.c

index 42b8f35..878d340 100644 (file)
@@ -131,8 +131,11 @@ swapchain_tdm_queue_present_image(VkQueue                                   queue,
                VK_ERROR("pthread_mutex_lock free queue failed\n");
 
        tsq_err = tbm_surface_queue_release(swapchain_tdm->tbm_queue, tbm_surface);
-       VK_CHECK(tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE, return VK_ERROR_SURFACE_LOST_KHR,
-                        "tbm_surface_queue_release failed.\n");
+       if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) {
+               VK_ERROR("tbm_surface_queue_release failed.\n");
+               pthread_mutex_unlock(&swapchain_tdm->free_queue_mutex);
+               return VK_ERROR_SURFACE_LOST_KHR;
+       }
 
        pthread_mutex_unlock(&swapchain_tdm->free_queue_mutex);
        pthread_cond_signal(&swapchain_tdm->free_queue_cond);
@@ -248,8 +251,12 @@ swapchain_tdm_acquire_next_image(VkDevice                   device,
        }
 
        tsq_err = tbm_surface_queue_dequeue(swapchain_tdm->tbm_queue, tbm_surface);
-       VK_CHECK(tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE, return VK_ERROR_SURFACE_LOST_KHR,
-                        "tbm_surface_queue_dequeue failed.\n");
+       if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) {
+               VK_ERROR("tbm_surface_queue_dequeue failed.\n");
+               pthread_mutex_unlock(&swapchain_tdm->free_queue_mutex);
+               return VK_ERROR_SURFACE_LOST_KHR;
+       }
+
        pthread_mutex_unlock(&swapchain_tdm->free_queue_mutex);
 
        if (sync)