Module: Mesa
Branch: master
Commit: c6731daa5e70a28f5577a7aa572cad59e49caba2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6731daa5e70a28f5577a7aa572cad59e49caba2

Author: Giovanni Mascellani <[email protected]>
Date:   Thu Feb 11 14:27:39 2021 +0100

disk_cache: Fail creation when cannot inizialize queue.

Signed-off-by: Giovanni Mascellani <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Fixes: e2c4435b078a ("util/disk_cache: add thread queue to disk cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8983>

---

 src/util/disk_cache.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index c2bb018d75a..402991a9e4d 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -162,10 +162,11 @@ disk_cache_create(const char *gpu_name, const char 
*driver_id,
     * The queue will resize automatically when it's full, so adding new jobs
     * doesn't stall.
     */
-   util_queue_init(&cache->cache_queue, "disk$", 32, 4,
-                   UTIL_QUEUE_INIT_RESIZE_IF_FULL |
-                   UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY |
-                   UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY);
+   if (!util_queue_init(&cache->cache_queue, "disk$", 32, 4,
+                        UTIL_QUEUE_INIT_RESIZE_IF_FULL |
+                        UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY |
+                        UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY))
+      goto fail;
 
    cache->path_init_failed = false;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to