Revert "d3d11device: protect device_lock vs device_new"

This reverts commit 0cb12db96c
(i.e. commit 926d5366b9 on main).

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/6907>
This commit is contained in:
Seungha Yang 2024-05-23 17:29:54 +09:00 committed by Backport Bot
parent 7526919fb3
commit a648f0da81
2 changed files with 0 additions and 24 deletions

View file

@ -705,8 +705,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)
{
@ -715,7 +713,6 @@ gst_d3d11_device_dispose (GObject * object)
GST_LOG_OBJECT (self, "dispose");
AcquireSRWLockExclusive (&_device_creation_rwlock);
priv->ps_cache.clear ();
priv->vs_cache.clear ();
priv->sampler_cache.clear ();
@ -741,7 +738,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);
}
@ -974,7 +970,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);
@ -1336,8 +1331,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");
@ -1363,8 +1356,6 @@ gst_d3d11_device_unlock (GstD3D11Device * device)
priv->extern_lock.unlock ();
GST_TRACE_OBJECT (device, "device unlocked");
ReleaseSRWLockShared (&_device_creation_rwlock);
}
/**

View file

@ -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;