From c55147b24a2752bd86aa559d2397a9dc54feb582 Mon Sep 17 00:00:00 2001
From: Morph <39850852+Morph1984@users.noreply.github.com>
Date: Wed, 25 Jan 2023 16:03:54 -0500
Subject: input_common: Make use of StoppableTimedWait

---
 src/input_common/drivers/gc_adapter.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/input_common/drivers/gc_adapter.cpp')

diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index ecb3e9dc29..d09ff178b6 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})) {
     }
 }
 
-- 
cgit v1.2.3-70-g09d2