mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-08 18:40:44 +00:00
Even though libusb is supposed to be thread-safe, in practice it's not (at least on Windows); getting a list of devices from two different threads can result in libusb crashes. This is easily fixed by waiting for the scan thread to complete scanning instead of running the scan on the CPU thread. This also fixes an issue that I had overlooked in the initial implementation: IOS interfaces such as OH0 are sometimes opened every frame, in which case we were doing a full device scan every single frame on the CPU thread!