mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 11:48:36 +12:00
Make sure hid_enumerate isn't called simultaneously in different threads
This commit is contained in:
parent
99db73a34f
commit
abd059c379
1 changed files with 5 additions and 2 deletions
|
@ -199,7 +199,11 @@ void hid_pad_handler<Device>::enumerate_devices()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
std::lock_guard lock(m_enumeration_mutex);
|
||||||
|
|
||||||
|
#ifndef ANDROID
|
||||||
for (const auto& [vid, pid] : m_ids)
|
for (const auto& [vid, pid] : m_ids)
|
||||||
{
|
{
|
||||||
hid_device_info* dev_info = hid_enumerate(vid, pid);
|
hid_device_info* dev_info = hid_enumerate(vid, pid);
|
||||||
|
@ -230,7 +234,6 @@ void hid_pad_handler<Device>::enumerate_devices()
|
||||||
#endif
|
#endif
|
||||||
hid_log.notice("%s enumeration found %d devices (%f ms)", m_type, device_paths.size(), timer.GetElapsedTimeInMilliSec());
|
hid_log.notice("%s enumeration found %d devices (%f ms)", m_type, device_paths.size(), timer.GetElapsedTimeInMilliSec());
|
||||||
|
|
||||||
std::lock_guard lock(m_enumeration_mutex);
|
|
||||||
m_new_enumerated_devices = device_paths;
|
m_new_enumerated_devices = device_paths;
|
||||||
m_enumerated_serials = std::move(serials);
|
m_enumerated_serials = std::move(serials);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue