vkd3d: Fix potential deadlock in descriptor QA checks.

If we destroy device right after creating it, we risk a deadlock.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-06-10 18:34:29 +02:00
parent 76a8914d6b
commit 58854b0a9c
1 changed files with 2 additions and 1 deletions

View File

@ -157,7 +157,8 @@ static void *vkd3d_descriptor_debug_qa_check_entry(void *userdata)
{
/* Don't spin endlessly, this thread is kicked after a successful fence wait. */
pthread_mutex_lock(&global_info->ring_lock);
pthread_cond_wait(&global_info->ring_cond, &global_info->ring_lock);
if (global_info->active)
pthread_cond_wait(&global_info->ring_cond, &global_info->ring_lock);
active = global_info->active;
pthread_mutex_unlock(&global_info->ring_lock);