Revert "d3d11device: protect device_lock vs device_new"
This reverts commit 926d5366b99b3498632a45147cfa329dbbf2cc30. AcquireSRWLockExclusive seems to be acquiring lock in exclusive mode when the same lock is combined with write lock access. Reverting the commit because of this is unexpected behavior and unavoidable OS bug. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
This commit is contained in:
parent
2f2279abf4
commit
f47a198977
@ -748,8 +748,6 @@ gst_d3d11_device_log_live_objects (GstD3D11Device * device,
|
||||
#endif
|
||||
}
|
||||
|
||||
static SRWLOCK _device_creation_rwlock = SRWLOCK_INIT;
|
||||
|
||||
static void
|
||||
gst_d3d11_device_dispose (GObject * object)
|
||||
{
|
||||
@ -764,8 +762,6 @@ gst_d3d11_device_dispose (GObject * object)
|
||||
g_clear_pointer (&priv->device_removed_monitor_thread, g_thread_join);
|
||||
}
|
||||
|
||||
AcquireSRWLockExclusive (&_device_creation_rwlock);
|
||||
|
||||
priv->ps_cache.clear ();
|
||||
priv->vs_cache.clear ();
|
||||
priv->sampler_cache.clear ();
|
||||
@ -792,7 +788,6 @@ gst_d3d11_device_dispose (GObject * object)
|
||||
GST_D3D11_CLEAR_COM (priv->dxgi_info_queue);
|
||||
#endif
|
||||
|
||||
ReleaseSRWLockExclusive (&_device_creation_rwlock);
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@ -1060,7 +1055,6 @@ gst_d3d11_device_new_internal (const GstD3D11DeviceConstructData * data)
|
||||
|
||||
debug_init_once ();
|
||||
|
||||
GstD3D11SRWLockGuard lk (&_device_creation_rwlock);
|
||||
hr = CreateDXGIFactory1 (IID_PPV_ARGS (&factory));
|
||||
if (!gst_d3d11_result (hr, NULL)) {
|
||||
GST_WARNING ("cannot create dxgi factory, hr: 0x%x", (guint) hr);
|
||||
@ -1434,8 +1428,6 @@ gst_d3d11_device_lock (GstD3D11Device * device)
|
||||
|
||||
priv = device->priv;
|
||||
|
||||
AcquireSRWLockShared (&_device_creation_rwlock);
|
||||
|
||||
GST_TRACE_OBJECT (device, "device locking");
|
||||
priv->extern_lock.lock ();
|
||||
GST_TRACE_OBJECT (device, "device locked");
|
||||
@ -1461,8 +1453,6 @@ gst_d3d11_device_unlock (GstD3D11Device * device)
|
||||
|
||||
priv->extern_lock.unlock ();
|
||||
GST_TRACE_OBJECT (device, "device unlocked");
|
||||
|
||||
ReleaseSRWLockShared (&_device_creation_rwlock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,20 +241,6 @@ GST_START_TEST (test_device_new_concurrency)
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_device_lock_recursiveness)
|
||||
{
|
||||
GstD3D11Device *device = gst_d3d11_device_new (0, 0);
|
||||
|
||||
gst_d3d11_device_lock (device);
|
||||
gst_d3d11_device_lock (device);
|
||||
gst_d3d11_device_unlock (device);
|
||||
gst_d3d11_device_unlock (device);
|
||||
|
||||
gst_object_unref (device);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
static Suite *
|
||||
d3d11device_suite (void)
|
||||
{
|
||||
@ -270,7 +256,6 @@ d3d11device_suite (void)
|
||||
tcase_add_test (tc_basic, test_device_for_adapter_luid);
|
||||
tcase_add_test (tc_basic, test_device_new_wrapped);
|
||||
tcase_add_test (tc_basic, test_device_new_concurrency);
|
||||
tcase_add_test (tc_basic, test_device_lock_recursiveness);
|
||||
|
||||
out:
|
||||
return s;
|
||||
|
Loading…
x
Reference in New Issue
Block a user