diff options
author | Giovanni Mascellani <gmascellani@codeweavers.com> | 2021-02-11 14:27:39 +0100 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-02-18 12:59:39 -0800 |
commit | 7ac677a051a2e7e2c804d0b3b4517f94f81c1025 (patch) | |
tree | 5fc9a256e709b6693e4b647f9bd7d440e3d8a3b6 | |
parent | 9948a0f15499b8a90991fd96f66b8ca570516ba9 (diff) |
disk_cache: Fail creation when cannot inizialize queue.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Fixes: e2c4435b078a ("util/disk_cache: add thread queue to disk cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8983>
(cherry picked from commit c6731daa5e70a28f5577a7aa572cad59e49caba2)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/util/disk_cache.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 89c178f4a4a..e2b254b4be7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3595,7 +3595,7 @@ "description": "disk_cache: Fail creation when cannot inizialize queue.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "e2c4435b078a1471b044219552873a54b1817bac" }, 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; |