anv: Add missing unlock in anv_scratch_pool_alloc
authorAlex Smith <asmith@feralinteractive.com>
Thu, 4 Jan 2018 11:28:46 +0000 (11:28 +0000)
committerAlex Smith <asmith@feralinteractive.com>
Thu, 4 Jan 2018 14:54:02 +0000 (14:54 +0000)
Fixes hangs seen due to the lock not being released here.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_allocator.c

index 33bd3c68c55f69e061a03eab05345bd5b75162c7..fe14d6cfabd1959cf89e141f2967bf89a97fabf8 100644 (file)
@@ -1088,8 +1088,10 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
    pthread_mutex_lock(&device->mutex);
 
    __sync_synchronize();
-   if (bo->exists)
+   if (bo->exists) {
+      pthread_mutex_unlock(&device->mutex);
       return &bo->bo;
+   }
 
    const struct anv_physical_device *physical_device =
       &device->instance->physicalDevice;