fix arm64

This commit is contained in:
lizzie 2026-05-23 22:52:40 +00:00
parent 3ea510550a
commit c9ced93936
3 changed files with 7 additions and 1 deletions

View file

@ -216,6 +216,11 @@ bool Event::WaitFor(const std::chrono::nanoseconds time) {
if (is_set.load())
Reset();
return true;
#elif defined(__FreeBSD__)
while (!is_set.load() && end > _rdtsc())
_mm_pause();
bool expected = true;
return is_set.compare_exchange_weak(expected, false, std::memory_order_release);
#else
std::unique_lock lk{mutex};
if (!condvar.wait_for(lk, time, [this] { return is_set.load(); }))

View file

@ -15,7 +15,6 @@
#include <thread>
#include "common/common_types.h"
#include "common/polyfill_thread.h"
#include "common/x64/rdtsc.h"
namespace Common {

View file

@ -16,8 +16,10 @@
#include "common/bit_util.h"
#include "common/common_types.h"
#include "common/logging.h"
#ifdef ARCHITECTURE_x86_64
#include "common/x64/cpu_detect.h"
#include "common/x64/rdtsc.h"
#endif
#ifdef _WIN32
#include <windows.h>