Atomic Stores / Loads
This commit is contained in:
parent
5c646d334a
commit
ab124b96c4
|
@ -47,7 +47,7 @@ void PulseAudio::SoundLoop()
|
||||||
|
|
||||||
if (PulseInit())
|
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);
|
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, NULL);
|
||||||
|
|
||||||
if(m_pa_error < 0)
|
if(m_pa_error < 0)
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include <pulse/pulseaudio.h>
|
#include <pulse/pulseaudio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "SoundStream.h"
|
#include "SoundStream.h"
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ private:
|
||||||
static void UnderflowCallback(pa_stream *s, void *userdata);
|
static void UnderflowCallback(pa_stream *s, void *userdata);
|
||||||
|
|
||||||
std::thread m_thread;
|
std::thread m_thread;
|
||||||
bool m_run_thread;
|
std::atomic<bool> m_run_thread;
|
||||||
|
|
||||||
int m_pa_error;
|
int m_pa_error;
|
||||||
int m_pa_connected;
|
int m_pa_connected;
|
||||||
|
|
Loading…
Reference in New Issue