[Vulkan Snapshot] tryLock when an API might create extra handles
We acquire the lock when createExtraHandlecsForNextApi is called. But depending on config, vkCreateDescriptorPool may or may not call createExtraHandlesForNextApi, which results in inconsistency of the lock state when calling snapshot()->vkCreateDescriptorPool. We add a tryLock so that it always acquires the lock before modifying mReconstruction. Reviewed-by: Aaron Ruby <aruby@blackberry.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
@@ -300,7 +300,9 @@ def emit_impl(typeInfo, api, cgen):
|
||||
if p.pointerIndirectionLevels > 0:
|
||||
cgen.stmt("if (!%s) return" % access)
|
||||
isCreateExtraHandleApi = api.name in apiCrreateExtraHandles
|
||||
if not isCreateExtraHandleApi:
|
||||
if isCreateExtraHandleApi:
|
||||
cgen.stmt("mLock.tryLock()");
|
||||
else:
|
||||
cgen.stmt("android::base::AutoLock lock(mLock)")
|
||||
cgen.line("// %s create" % p.paramName)
|
||||
if p.isCreatedBy(api):
|
||||
|
||||
Reference in New Issue
Block a user