early-access version 2203

This commit is contained in:
pineappleEA
2021-11-15 23:04:15 +01:00
parent 89013ee4f7
commit 0386e477a0
3 changed files with 7 additions and 11 deletions

View File

@@ -58,8 +58,7 @@ u64 NativeClock::GetRTSC() {
TimePoint new_time_point{};
TimePoint current_time_point{};
do {
std::ignore = Common::AtomicCompareAndSwap(current_time_point.pack.data(), time_point.pack,
u128{0}); // comparison value doesn't matter
current_time_point.pack = time_point.pack;
_mm_mfence();
const u64 current_measure = __rdtsc();
u64 diff = current_measure - current_time_point.inner.last_measure;
@@ -79,9 +78,7 @@ void NativeClock::Pause(bool is_paused) {
TimePoint current_time_point{};
TimePoint new_time_point{};
do {
std::ignore =
Common::AtomicCompareAndSwap(current_time_point.pack.data(), time_point.pack,
u128{0}); // comparison value doesn't matter
current_time_point.pack = time_point.pack;
new_time_point.pack = current_time_point.pack;
_mm_mfence();
new_time_point.inner.last_measure = __rdtsc();