From ab124b96c4d952255986779b0dec303ef8921fd3 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 3 Feb 2014 22:52:34 +0100 Subject: [PATCH] Atomic Stores / Loads --- Source/Core/AudioCommon/PulseAudioStream.cpp | 2 +- Source/Core/AudioCommon/PulseAudioStream.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/AudioCommon/PulseAudioStream.cpp b/Source/Core/AudioCommon/PulseAudioStream.cpp index 685d5365a8..fe68d0eb6c 100644 --- a/Source/Core/AudioCommon/PulseAudioStream.cpp +++ b/Source/Core/AudioCommon/PulseAudioStream.cpp @@ -47,7 +47,7 @@ void PulseAudio::SoundLoop() if (PulseInit()) { - while (m_run_thread && m_pa_connected == 1 && m_pa_error >= 0) + while (m_run_thread.load() && m_pa_connected == 1 && m_pa_error >= 0) m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL); if(m_pa_error < 0) diff --git a/Source/Core/AudioCommon/PulseAudioStream.h b/Source/Core/AudioCommon/PulseAudioStream.h index d3087df263..3164a4ee94 100644 --- a/Source/Core/AudioCommon/PulseAudioStream.h +++ b/Source/Core/AudioCommon/PulseAudioStream.h @@ -9,6 +9,8 @@ #include #endif +#include + #include "Common.h" #include "SoundStream.h" @@ -45,7 +47,7 @@ private: static void UnderflowCallback(pa_stream *s, void *userdata); std::thread m_thread; - bool m_run_thread; + std::atomic m_run_thread; int m_pa_error; int m_pa_connected;