mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Use Common::Flag and Common::Event when possible
Replaces old and simple usages of std::atomic<bool> 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.
This commit is contained in:
@ -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();
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user