mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Use Common::Flag and Common::Event when possible
Replaces old and simple usages of std::atomic<bool> with Common::Flag (which was introduced after the initial usage), so it's clear that the variable is a flag and because Common::Flag is well tested. This also replaces the ready logic in WiimoteReal with Common::Event since it was basically just unnecessarily reimplementing Common::Event.
This commit is contained in:
@ -27,7 +27,7 @@ bool PulseAudio::Start()
|
||||
|
||||
NOTICE_LOG(AUDIO, "PulseAudio backend using %d channels", m_channels);
|
||||
|
||||
m_run_thread = true;
|
||||
m_run_thread.Set();
|
||||
m_thread = std::thread(&PulseAudio::SoundLoop, this);
|
||||
|
||||
// Initialize DPL2 parameters
|
||||
@ -38,7 +38,7 @@ bool PulseAudio::Start()
|
||||
|
||||
void PulseAudio::Stop()
|
||||
{
|
||||
m_run_thread = false;
|
||||
m_run_thread.Clear();
|
||||
m_thread.join();
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ void PulseAudio::SoundLoop()
|
||||
|
||||
if (PulseInit())
|
||||
{
|
||||
while (m_run_thread.load() && m_pa_connected == 1 && m_pa_error >= 0)
|
||||
while (m_run_thread.IsSet() && m_pa_connected == 1 && m_pa_error >= 0)
|
||||
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
|
||||
|
||||
if (m_pa_error < 0)
|
||||
|
Reference in New Issue
Block a user