summaryrefslogtreecommitdiffstats
path: root/src/common/x64/native_clock.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/x64/native_clock.h13
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{};