summaryrefslogtreecommitdiffstats
path: root/src/input_common/drivers/gc_adapter.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2023-01-25 22:03:54 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2023-01-25 22:43:04 +0100
commitc55147b24a2752bd86aa559d2397a9dc54feb582 (patch)
treeaeaa61a8c46d94629432d1dfc60de9fb8e7459de /src/input_common/drivers/gc_adapter.cpp
parentpolyfill_thread: Implement StoppableTimedWait (diff)
downloadyuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar.gz
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar.bz2
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar.lz
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar.xz
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.tar.zst
yuzu-c55147b24a2752bd86aa559d2397a9dc54feb582.zip
Diffstat (limited to 'src/input_common/drivers/gc_adapter.cpp')
-rw-r--r--src/input_common/drivers/gc_adapter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index ecb3e9dc2..d09ff178b 100644
--- a/src/input_common/drivers/gc_adapter.cpp
+++ b/src/input_common/drivers/gc_adapter.cpp
@@ -6,6 +6,7 @@
#include "common/logging/log.h"
#include "common/param_package.h"
+#include "common/polyfill_thread.h"
#include "common/settings_input.h"
#include "common/thread.h"
#include "input_common/drivers/gc_adapter.h"
@@ -217,8 +218,7 @@ void GCAdapter::AdapterScanThread(std::stop_token stop_token) {
Common::SetCurrentThreadName("ScanGCAdapter");
usb_adapter_handle = nullptr;
pads = {};
- while (!stop_token.stop_requested() && !Setup()) {
- std::this_thread::sleep_for(std::chrono::seconds(2));
+ while (!Setup() && Common::StoppableTimedWait(stop_token, std::chrono::seconds{2})) {
}
}