mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 05:10:11 +01:00
anv: try to help coverity understand we're not racing
Coverity notices that in this case part of the decision to go down the locked path invovles reading a flag, which is turn set inside the protected code. Additional threads can decide they need to go down the locked path, and then wait on the lock, even though the first thread willse the device_registered to true, which would have otherwise prevented them from going down the locked path. What Coverity doesn't know, is that it is a violation of the Vulkan API contract to call this function from two different threads, so in practice that cann't happen. We'll move the setting of the image_device_registered out of the locked area to see if that pacifies Coverity, and if not then we'll just ignore it. CID: 1662067 Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37582>
This commit is contained in:
parent
aa28fcb610
commit
74018f41ab
1 changed files with 1 additions and 1 deletions
|
|
@ -3151,8 +3151,8 @@ anv_bind_image_memory(struct anv_device *device,
|
|||
!image->device_registered) {
|
||||
pthread_mutex_lock(&device->mutex);
|
||||
list_addtail(&image->link, &device->image_private_objects);
|
||||
image->device_registered = true;
|
||||
pthread_mutex_unlock(&device->mutex);
|
||||
image->device_registered = true;
|
||||
}
|
||||
|
||||
if (bind_status)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue