From 6e180db114fb60ed4b4de5ecbb41085d620b7f30 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Fri, 30 Apr 2021 13:18:48 +0900 Subject: [PATCH] Add missing pthread_mutex_unlock Change-Id: I082412adb77524469af5a436a386e54cce5f7449 Signed-off-by: Joonbum Ko --- src/wsi/swapchain_tdm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wsi/swapchain_tdm.c b/src/wsi/swapchain_tdm.c index 42b8f35..878d340 100644 --- a/src/wsi/swapchain_tdm.c +++ b/src/wsi/swapchain_tdm.c @@ -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) -- 2.7.4