Skip to content

Commit

Permalink
Merge pull request #2835 from degasus/master
Browse files Browse the repository at this point in the history
Wiimotes: Initialize all atomic<bool> globally.
  • Loading branch information
degasus authored and CrossVR committed Aug 12, 2015
1 parent d431525 commit 6911e24
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Source/Core/Core/HW/WiimoteReal/IONix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class WiimoteLinux final : public Wiimote
};

WiimoteScanner::WiimoteScanner()
: m_want_wiimotes()
, device_id(-1)
: device_id(-1)
, device_sock(-1)
{
// Get the id of the first Bluetooth device.
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/HW/WiimoteReal/IOWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ void RemoveWiimote(BLUETOOTH_DEVICE_INFO_STRUCT&);
bool ForgetWiimote(BLUETOOTH_DEVICE_INFO_STRUCT&);

WiimoteScanner::WiimoteScanner()
: m_run_thread()
, m_want_wiimotes()
{
init_lib();
}
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/HW/WiimoteReal/IOdarwin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ @interface ConnectBT: NSObject {}
};

WiimoteScanner::WiimoteScanner()
: m_run_thread()
, m_want_wiimotes()
{}

WiimoteScanner::~WiimoteScanner()
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Wiimote::Wiimote()
, m_last_input_report()
, m_channel(0)
, m_rumble_state()
, m_need_prepare()
{}

void Wiimote::Shutdown()
Expand Down
12 changes: 6 additions & 6 deletions Source/Core/Core/HW/WiimoteReal/WiimoteReal.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ friend class WiimoteEmu::Wiimote;

std::thread m_wiimote_thread;
// Whether to keep running the thread.
std::atomic<bool> m_run_thread;
std::atomic<bool> m_run_thread {false};
// Whether to call PrepareOnThread.
std::atomic<bool> m_need_prepare;
std::atomic<bool> m_need_prepare {false};
// Whether the thread has finished ConnectInternal.
std::atomic<bool> m_thread_ready;
std::atomic<bool> m_thread_ready {false};
std::mutex m_thread_ready_mutex;
std::condition_variable m_thread_ready_cond;

Expand Down Expand Up @@ -135,9 +135,9 @@ class WiimoteScanner

std::thread m_scan_thread;

std::atomic<bool> m_run_thread;
std::atomic<bool> m_want_wiimotes;
std::atomic<bool> m_want_bb;
std::atomic<bool> m_run_thread {false};
std::atomic<bool> m_want_wiimotes {false};
std::atomic<bool> m_want_bb {false};

#if defined(_WIN32)
void CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool &real_wiimote, bool &is_bb);
Expand Down

0 comments on commit 6911e24

Please sign in to comment.