aaaaaaaaaaaaaarm

This commit is contained in:
lizzie 2026-05-24 02:01:24 +00:00
parent 33f6f5bba3
commit bf6d92f845
3 changed files with 3 additions and 12 deletions

View file

@ -231,22 +231,11 @@ bool Event::WaitFor(const std::chrono::nanoseconds time) {
}
#else
bool Event::WaitFor(const std::chrono::nanoseconds time) {
#ifdef _WIN32
s64 rem = s64(time.count()); //98 years
while (!is_set.load() && rem > 0) {
Common::Windows::SleepForOneTick();
rem = s64(Common::g_wall_clock.GetGlobalTimeNs().count()) - s64(time.count());
}
if (is_set.load())
Reset();
return true;
#else
std::unique_lock lk{mutex};
if (!condvar.wait_for(lk, time, [this] { return is_set.load(); }))
return false;
is_set = false;
return true;
#endif
}
#endif