DetectionManager: controller lifecycle and thread-safe registration

This commit is contained in:
Ken Sanislo authored and Adam Honse committed 2026-07-19 02:04:46 -05:00
1 parent 8fb790358f
commit b35e119325
5 files changed
+117 -25

No files matched your search

+5 -1
View File
@@ -713,9 +713,13 @@ void ResourceManager::UpdateDeviceList()
rgb_controller_interfaces.clear();
/*-----------------------------------------------------*\
| Insert hardware controllers into controller list |
| Insert hardware controllers into controller list. |
| Hold the detection lock across the copy so a |
| concurrent registration cannot invalidate the list. |
\*-----------------------------------------------------*/
DetectionManager::get()->LockRGBControllers();
rgb_controllers_hw = DetectionManager::get()->GetRGBControllers();
DetectionManager::get()->UnlockRGBControllers();
for(std::size_t rgb_controller_idx = 0; rgb_controller_idx < rgb_controllers_hw.size(); rgb_controller_idx++)
{