mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 06:29:00 +01:00
ISO/USB: fix potential race condition
This commit is contained in:
parent
a161e58591
commit
1f4b9adbf5
@ -179,9 +179,8 @@ void USBHost::StartThreads()
|
||||
if (Core::WantsDeterminism())
|
||||
return;
|
||||
|
||||
if (!m_scan_thread_running.IsSet())
|
||||
if (m_scan_thread_running.TestAndSet())
|
||||
{
|
||||
m_scan_thread_running.Set();
|
||||
m_scan_thread = std::thread([this] {
|
||||
Common::SetCurrentThreadName("USB Scan Thread");
|
||||
while (m_scan_thread_running.IsSet())
|
||||
|
Loading…
x
Reference in New Issue
Block a user