6c1f6f7f
by Vibhav Pant at 2025-12-05T11:09:50+01:00
winebth.sys: Fix potential deadlocks while performing operations that block on the DBus event loop.
Disconnecting and removing remote devices hold device_list_cs before blocking on the DBus event
loop, which may cause a deadlock if we receive a message from BlueZ whose handler also attempts to
enter device_list_cs (Like BLUETOOTH_WATCHER_EVENT_TYPE_DEVICE_PROPERTIES_CHANGED). To fix this, the
device/radio handle is duplicated once found, device_list_cs is released, and the DBus method call
is made using the duplicate handle(s), which are then freed normally.