diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2020-08-02 23:20:33 +0100 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2020-08-08 21:40:23 +0100 |
| commit | 1f4b9adbf569fe851c314bc4eae2dc0d9f3b5a4f (patch) | |
| tree | f379c9cf0a610a7e6aac08362bf07ecc9888236a /Source/Core | |
| parent | a161e58591cadc504c9751a563f4c065ad0f435a (diff) | |
ISO/USB: fix potential race condition
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/USB/Host.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/Core/Core/IOS/USB/Host.cpp b/Source/Core/Core/IOS/USB/Host.cpp index f6ab6ed661..460f5a859f 100644 --- a/Source/Core/Core/IOS/USB/Host.cpp +++ b/Source/Core/Core/IOS/USB/Host.cpp @@ -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()) |
