From dca22e08eb96a401406ef7fa62c59eea1b837f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 5 Aug 2016 16:04:39 +0200 Subject: Use Common::Flag and Common::Event when possible Replaces old and simple usages of std::atomic 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. --- Source/Core/AudioCommon/AOSoundStream.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/AudioCommon/AOSoundStream.cpp') diff --git a/Source/Core/AudioCommon/AOSoundStream.cpp b/Source/Core/AudioCommon/AOSoundStream.cpp index 6dc1219e88..93f1759785 100644 --- a/Source/Core/AudioCommon/AOSoundStream.cpp +++ b/Source/Core/AudioCommon/AOSoundStream.cpp @@ -34,7 +34,7 @@ void AOSound::SoundLoop() buf_size = format.bits / 8 * format.channels * format.rate; - while (m_run_thread.load()) + while (m_run_thread.IsSet()) { m_mixer->Mix(realtimeBuffer, numBytesToRender >> 2); @@ -49,7 +49,7 @@ void AOSound::SoundLoop() bool AOSound::Start() { - m_run_thread.store(true); + m_run_thread.Set(); memset(realtimeBuffer, 0, sizeof(realtimeBuffer)); thread = std::thread(&AOSound::SoundLoop, this); @@ -63,7 +63,7 @@ void AOSound::Update() void AOSound::Stop() { - m_run_thread.store(false); + m_run_thread.Clear(); soundSyncEvent.Set(); { -- cgit v1.2.3