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())
|
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…
Reference in New Issue