From dca22e08eb96a401406ef7fa62c59eea1b837f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 5 Aug 2016 16:04:39 +0200 Subject: Use Common::Flag and Common::Event when possible Replaces old and simple usages of std::atomic 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. --- Source/Core/VideoCommon/Fifo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/Fifo.cpp') diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp index 504a274157..8d3df111e4 100644 --- a/Source/Core/VideoCommon/Fifo.cpp +++ b/Source/Core/VideoCommon/Fifo.cpp @@ -36,7 +36,7 @@ static bool s_skip_current_frame = false; static Common::BlockingLoop s_gpu_mainloop; -static std::atomic s_emu_running_state; +static Common::Flag s_emu_running_state; // Most of this array is unlikely to be faulted in... static u8 s_fifo_aux_data[FIFO_SIZE]; @@ -147,13 +147,13 @@ void ExitGpuLoop() FlushGpu(); // Terminate GPU thread loop - s_emu_running_state.store(true); + s_emu_running_state.Set(); s_gpu_mainloop.Stop(false); } void EmulatorState(bool running) { - s_emu_running_state.store(running); + s_emu_running_state.Set(running); if (running) s_gpu_mainloop.Wakeup(); else @@ -307,7 +307,7 @@ void RunGpuLoop() g_video_backend->PeekMessages(); // Do nothing while paused - if (!s_emu_running_state.load()) + if (!s_emu_running_state.IsSet()) return; if (s_use_deterministic_gpu_thread) -- cgit v1.2.3