vulkan/runtime: repair thread safety in method vk_queue_start_submit_thread()
authorIllia Abernikhin <illia.abernikhin@globallogic.com>
Mon, 4 Apr 2022 13:37:28 +0000 (16:37 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Apr 2022 14:15:29 +0000 (14:15 +0000)
commitdd24ab86cc2e3dc5b3082f17b2902f6abf15c153
tree03ec1eb0863a4ebfd03b7dfba9c803823e3c560f
parentca40bad84a535b80476d9b01d792ffdf71970d98
vulkan/runtime: repair thread safety in method vk_queue_start_submit_thread()

Accessing queue->submit.thread_run without holding lock vk_queue.submit.mutex.
Elsewhere, vk_queue.submit.thread_run is accessed with vk_queue.mutex
held 1 out of 2 times (1 of these accesses strongly imply that it is necessary).

Found by Coverity.
CID: 1503334

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15736>
src/vulkan/runtime/vk_queue.c