forked from dolphin-emu/dolphin
c238e49119
also make it more thread safe (avoid rare deadlock) and fix it trying to add devices before the CI has init