summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/AOSoundStream.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-05-14 13:31:28 +1000
committerskidau <skidau@gmail.com>2015-05-14 13:31:28 +1000
commite35148fe1528e31bc991ac1dfa5622ec76d7bde4 (patch)
treeb74528e1f99a1c36aadee74dae4c9f8c4bac7a4a /Source/Core/AudioCommon/AOSoundStream.cpp
parent38c7021109e525f0adbdb755d3d3532c3517cecb (diff)
parentf907e5cacee4f0a6c250f0d640eb11d006475f6b (diff)
Merge pull request #2387 from lioncash/atomic
AudioCommon: Remove usages of volatile variables.
Diffstat (limited to 'Source/Core/AudioCommon/AOSoundStream.cpp')
-rw-r--r--Source/Core/AudioCommon/AOSoundStream.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/AOSoundStream.cpp b/Source/Core/AudioCommon/AOSoundStream.cpp
index 7def6331a3..7aa9de9ac4 100644
--- a/Source/Core/AudioCommon/AOSoundStream.cpp
+++ b/Source/Core/AudioCommon/AOSoundStream.cpp
@@ -32,7 +32,7 @@ void AOSound::SoundLoop()
buf_size = format.bits/8 * format.channels * format.rate;
- while (!threadData)
+ while (m_run_thread.load())
{
m_mixer->Mix(realtimeBuffer, numBytesToRender >> 2);
@@ -47,6 +47,7 @@ void AOSound::SoundLoop()
bool AOSound::Start()
{
+ m_run_thread.store(true);
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
thread = std::thread(&AOSound::SoundLoop, this);
@@ -60,7 +61,7 @@ void AOSound::Update()
void AOSound::Stop()
{
- threadData = 1;
+ m_run_thread.store(false);
soundSyncEvent.Set();
{