summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/WASAPIStream.cpp
diff options
context:
space:
mode:
authorSilent <zdanio95@gmail.com>2019-08-17 10:13:01 +0200
committerSilent <zdanio95@gmail.com>2021-01-12 19:21:54 +0100
commit7d59ad262f1e22f7f570c91c28f5d01cd93970a6 (patch)
tree807952ae5cb5abd7604fbbf7ac2ca1a102c377fe /Source/Core/AudioCommon/WASAPIStream.cpp
parentee60be45010fed98a3d28f736bcf00efb036560c (diff)
AudioCommon/WASAPI: Use leaner memory model on m_running, no need for a full barrier
Diffstat (limited to 'Source/Core/AudioCommon/WASAPIStream.cpp')
-rw-r--r--Source/Core/AudioCommon/WASAPIStream.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/AudioCommon/WASAPIStream.cpp b/Source/Core/AudioCommon/WASAPIStream.cpp
index 2d502c3f7c..794fb6781a 100644
--- a/Source/Core/AudioCommon/WASAPIStream.cpp
+++ b/Source/Core/AudioCommon/WASAPIStream.cpp
@@ -45,7 +45,7 @@ WASAPIStream::WASAPIStream()
WASAPIStream::~WASAPIStream()
{
- m_running = false;
+ m_running.store(false, std::memory_order_relaxed);
if (m_thread.joinable())
m_thread.join();
}
@@ -327,12 +327,12 @@ bool WASAPIStream::SetRunning(bool running)
m_audio_renderer = std::move(audio_renderer);
m_need_data_event = std::move(need_data_event);
- m_running = true;
+ m_running.store(true, std::memory_order_relaxed);
m_thread = std::thread([this] { SoundLoop(); });
}
else
{
- m_running = false;
+ m_running.store(false, std::memory_order_relaxed);
if (m_thread.joinable())
m_thread.join();
@@ -356,7 +356,7 @@ void WASAPIStream::SoundLoop()
m_audio_renderer->ReleaseBuffer(m_frames_in_buffer, AUDCLNT_BUFFERFLAGS_SILENT);
}
- while (m_running)
+ while (m_running.load(std::memory_order_relaxed))
{
if (!m_audio_renderer)
continue;