diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-23 03:29:00 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-06-28 01:06:48 +0200 |
commit | 096366ead51345bcd170e31b6160b14aaf73e996 (patch) | |
tree | db99c0d032466f4bd94871baaecf0544fec82f25 /src/common/x64/native_clock.h | |
parent | Merge pull request #8504 from comex/mesosphere-current-process (diff) | |
download | yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar.gz yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar.bz2 yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar.lz yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar.xz yuzu-096366ead51345bcd170e31b6160b14aaf73e996.tar.zst yuzu-096366ead51345bcd170e31b6160b14aaf73e996.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/x64/native_clock.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h index 30d2ba2e9..e57446cb9 100644 --- a/src/common/x64/native_clock.h +++ b/src/common/x64/native_clock.h @@ -3,6 +3,7 @@ #pragma once +#include <atomic> #include "common/wall_clock.h" namespace Common { @@ -28,13 +29,9 @@ public: private: u64 GetRTSC(); - union alignas(16) TimePoint { - TimePoint() : pack{} {} - u128 pack{}; - struct Inner { - u64 last_measure{}; - u64 accumulated_ticks{}; - } inner; + struct alignas(16) TimePoint { + u64 last_measure{}; + u64 accumulated_ticks{}; }; /// value used to reduce the native clocks accuracy as some apss rely on @@ -42,7 +39,7 @@ private: /// be higher. static constexpr u64 inaccuracy_mask = ~(UINT64_C(0x400) - 1); - TimePoint time_point; + std::atomic<TimePoint> time_point; // factors u64 clock_rtsc_factor{}; u64 cpu_rtsc_factor{}; |