mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 22:29:21 +00:00
ISO/USB: fix potential race condition
This commit is contained in:
parent
a161e58591
commit
1f4b9adbf5
1 changed files with 1 additions and 2 deletions
|
@ -179,9 +179,8 @@ void USBHost::StartThreads()
|
||||||
if (Core::WantsDeterminism())
|
if (Core::WantsDeterminism())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!m_scan_thread_running.IsSet())
|
if (m_scan_thread_running.TestAndSet())
|
||||||
{
|
{
|
||||||
m_scan_thread_running.Set();
|
|
||||||
m_scan_thread = std::thread([this] {
|
m_scan_thread = std::thread([this] {
|
||||||
Common::SetCurrentThreadName("USB Scan Thread");
|
Common::SetCurrentThreadName("USB Scan Thread");
|
||||||
while (m_scan_thread_running.IsSet())
|
while (m_scan_thread_running.IsSet())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue