mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-23 01:29:19 +01:00
Stop using std::jthread
, because Mac doesn't support it
This commit is contained in:
parent
ae2f5d23b3
commit
d52405935f
@ -16,7 +16,7 @@ WiimoteControllerProvider::WiimoteControllerProvider()
|
||||
{
|
||||
m_reader_thread = std::thread(&WiimoteControllerProvider::reader_thread, this);
|
||||
m_writer_thread = std::thread(&WiimoteControllerProvider::writer_thread, this);
|
||||
m_connectionThread = std::jthread(&WiimoteControllerProvider::connectionThread, this);
|
||||
m_connectionThread = std::thread(&WiimoteControllerProvider::connectionThread, this);
|
||||
}
|
||||
|
||||
WiimoteControllerProvider::~WiimoteControllerProvider()
|
||||
@ -26,6 +26,7 @@ WiimoteControllerProvider::~WiimoteControllerProvider()
|
||||
m_running = false;
|
||||
m_writer_thread.join();
|
||||
m_reader_thread.join();
|
||||
m_connectionThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,10 +144,10 @@ WiimoteControllerProvider::WiimoteState WiimoteControllerProvider::get_state(siz
|
||||
return {};
|
||||
}
|
||||
|
||||
void WiimoteControllerProvider::connectionThread(std::stop_token stopToken)
|
||||
void WiimoteControllerProvider::connectionThread()
|
||||
{
|
||||
SetThreadName("Wiimote-connect");
|
||||
while (!stopToken.stop_requested())
|
||||
while (m_running.load(std::memory_order_relaxed))
|
||||
{
|
||||
std::vector<WiimoteDevicePtr> devices;
|
||||
#if HAS_HIDAPI
|
||||
|
@ -79,7 +79,7 @@ private:
|
||||
std::thread m_reader_thread, m_writer_thread;
|
||||
std::shared_mutex m_device_mutex;
|
||||
|
||||
std::jthread m_connectionThread;
|
||||
std::thread m_connectionThread;
|
||||
std::vector<WiimoteDevicePtr> m_connectedDevices;
|
||||
std::mutex m_connectedDeviceMutex;
|
||||
struct Wiimote
|
||||
@ -104,7 +104,7 @@ private:
|
||||
|
||||
void reader_thread();
|
||||
void writer_thread();
|
||||
void connectionThread(std::stop_token);
|
||||
void connectionThread();
|
||||
|
||||
void calibrate(size_t index);
|
||||
IRMode set_ir_camera(size_t index, bool state);
|
||||
|
Loading…
Reference in New Issue
Block a user