d3d12commandqueue: Fix deadlock on drain()

Don't take lock if the drain() is called from the GC thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7013>
This commit is contained in:
Seungha Yang 2024-06-05 00:20:05 +09:00 committed by GStreamer Marge Bot
parent a2df44da7d
commit db47f46ad7

View file

@ -570,9 +570,13 @@ gst_d3d12_command_queue_drain (GstD3D12CommandQueue * queue)
}
{
std::lock_guard < std::mutex > lk (priv->lock);
gc_list = priv->gc_list;
priv->gc_list = { };
if (priv->gc_thread != g_thread_self ()) {
std::lock_guard < std::mutex > lk (priv->lock);
gc_list = priv->gc_list;
priv->gc_list = { };
} else {
priv->gc_list = { };
}
}
}