mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #11040 from AdmiralCurtiss/update-references-deadlock
InputCommon: Fix deadlock in EmulatedController::UpdateReferences().
This commit is contained in:
commit
348db11bdb
@ -40,7 +40,7 @@ std::unique_lock<std::recursive_mutex> EmulatedController::GetStateLock()
|
|||||||
|
|
||||||
void EmulatedController::UpdateReferences(const ControllerInterface& devi)
|
void EmulatedController::UpdateReferences(const ControllerInterface& devi)
|
||||||
{
|
{
|
||||||
const auto lock = GetStateLock();
|
std::scoped_lock lk(s_get_state_mutex, devi.GetDevicesMutex());
|
||||||
|
|
||||||
m_default_device_is_connected = devi.HasConnectedDevice(m_default_device);
|
m_default_device_is_connected = devi.HasConnectedDevice(m_default_device);
|
||||||
|
|
||||||
|
@ -238,6 +238,8 @@ public:
|
|||||||
std::chrono::milliseconds confirmation_wait,
|
std::chrono::milliseconds confirmation_wait,
|
||||||
std::chrono::milliseconds maximum_wait) const;
|
std::chrono::milliseconds maximum_wait) const;
|
||||||
|
|
||||||
|
std::recursive_mutex& GetDevicesMutex() const { return m_devices_mutex; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Exclusively needed when reading/writing "m_devices"
|
// Exclusively needed when reading/writing "m_devices"
|
||||||
mutable std::recursive_mutex m_devices_mutex;
|
mutable std::recursive_mutex m_devices_mutex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user