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>
This commit is contained in:
Illia Abernikhin
2022-04-04 16:37:28 +03:00
committed by Marge Bot
parent ca40bad84a
commit dd24ab86cc
+2
View File
@@ -520,7 +520,9 @@ vk_queue_start_submit_thread(struct vk_queue *queue)
{
int ret;
mtx_lock(&queue->submit.mutex);
queue->submit.thread_run = true;
mtx_unlock(&queue->submit.mutex);
ret = thrd_create(&queue->submit.thread,
vk_queue_submit_thread_func,