Fix data races on Get/SetIsThrottlerTempDisabled()

This commit is contained in:
nyanpasu64 2023-07-08 23:37:37 -07:00
parent 9b72524511
commit 0472960f1a
1 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ static std::thread s_emu_thread;
static std::vector<StateChangedCallbackFunc> s_on_state_changed_callbacks;
static std::thread s_cpu_thread;
static bool s_is_throttler_temp_disabled = false;
static std::atomic<bool> s_is_throttler_temp_disabled = false;
static std::atomic<double> s_last_actual_emulation_speed{1.0};
static bool s_frame_step = false;
static std::atomic<bool> s_stop_frame_step;
@ -147,12 +147,12 @@ static Common::EventHook s_frame_presented = AfterPresentEvent::Register(
bool GetIsThrottlerTempDisabled()
{
return s_is_throttler_temp_disabled;
return s_is_throttler_temp_disabled.load(std::memory_order_relaxed);
}
void SetIsThrottlerTempDisabled(bool disable)
{
s_is_throttler_temp_disabled = disable;
s_is_throttler_temp_disabled.store(disable, std::memory_order_relaxed);
}
double GetActualEmulationSpeed()