refactor: replace ARCH->time() with Arch::time()

This commit is contained in:
sithlord48
2025-06-15 20:11:48 -04:00
committed by Nick Bolton
parent 04943fad79
commit 84e289bc30
5 changed files with 17 additions and 17 deletions

View File

@ -421,7 +421,7 @@ bool ArchMultithreadPosix::wait(ArchThread target, double timeout)
// wait and repeat test if there's a timeout
if (timeout != 0.0) {
const double start = ARCH->time();
const double start = Arch::time();
do {
// wait a little
ARCH->sleep(0.05);
@ -434,7 +434,7 @@ bool ArchMultithreadPosix::wait(ArchThread target, double timeout)
}
// repeat wait and test until timed out
} while (timeout < 0.0 || (ARCH->time() - start) <= timeout);
} while (timeout < 0.0 || (Arch::time() - start) <= timeout);
}
closeThread(target);

View File

@ -415,11 +415,11 @@ void *EventQueue::getSystemTarget()
void EventQueue::waitForReady() const
{
double timeout = ARCH->time() + 10;
double timeout = Arch::time() + 10;
Lock lock(m_readyMutex);
while (!m_readyCondVar->wait()) {
if (ARCH->time() > timeout) {
if (Arch::time() > timeout) {
throw std::runtime_error("event queue is not ready within 5 sec");
}
}

View File

@ -15,7 +15,7 @@
Stopwatch::Stopwatch(bool triggered) : m_triggered(triggered), m_stopped(triggered)
{
if (!triggered) {
m_mark = ARCH->time();
m_mark = Arch::time();
}
}
@ -26,7 +26,7 @@ double Stopwatch::reset()
m_mark = 0.0;
return dt;
} else {
const double t = ARCH->time();
const double t = Arch::time();
const double dt = t - m_mark;
m_mark = t;
return dt;
@ -40,7 +40,7 @@ void Stopwatch::stop()
}
// save the elapsed time
m_mark = ARCH->time() - m_mark;
m_mark = Arch::time() - m_mark;
m_stopped = true;
}
@ -52,7 +52,7 @@ void Stopwatch::start()
}
// set the mark such that it reports the time elapsed at stop()
m_mark = ARCH->time() - m_mark;
m_mark = Arch::time() - m_mark;
m_stopped = false;
}
@ -71,7 +71,7 @@ double Stopwatch::getTime()
} else if (m_stopped) {
return m_mark;
} else {
return ARCH->time() - m_mark;
return Arch::time() - m_mark;
}
}
@ -90,7 +90,7 @@ double Stopwatch::getTime() const
if (m_stopped) {
return m_mark;
} else {
return ARCH->time() - m_mark;
return Arch::time() - m_mark;
}
}

View File

@ -196,7 +196,7 @@ void MSWindowsWatchdog::mainLoop(void *)
case StartScheduled: {
LOG_DEBUG3("watchdog process start scheduled");
if (m_nextStartTime.has_value() && m_nextStartTime.value() <= ARCH->time()) {
if (m_nextStartTime.has_value() && m_nextStartTime.value() <= Arch::time()) {
LOG_DEBUG("start time reached, queueing process start");
m_processState = StartPending;
}
@ -442,7 +442,7 @@ MSWindowsWatchdog::ProcessState MSWindowsWatchdog::handleStartError(const std::s
// When there has been more than one consecutive failure, slow down the retry rate.
if (m_startFailures > 1) {
m_nextStartTime = ARCH->time() + kStartDelaySeconds;
m_nextStartTime = Arch::time() + kStartDelaySeconds;
LOG_WARN("start failed %d times, delaying start", m_startFailures);
LOG_DEBUG("start delay, seconds=%d, time=%f", kStartDelaySeconds, m_nextStartTime.value());
return ProcessState::StartScheduled;

View File

@ -508,13 +508,13 @@ void OSXScreen::fakeMouseButton(ButtonID id, bool press)
// This will allow for higher than triple click but the quartz documenation
// does not specify that this should be limited to triple click
if (press) {
if ((ARCH->time() - m_lastClickTime) <= clickTime && diff <= maxDiff) {
if ((Arch::time() - m_lastClickTime) <= clickTime && diff <= maxDiff) {
m_clickState++;
} else {
m_clickState = 1;
}
m_lastClickTime = ARCH->time();
m_lastClickTime = Arch::time();
}
if (m_clickState == 1) {
@ -1752,11 +1752,11 @@ void OSXScreen::waitForCarbonLoop() const
LOG((CLOG_DEBUG "waiting for carbon loop"));
double timeout = ARCH->time() + kCarbonLoopWaitTimeout;
double timeout = Arch::time() + kCarbonLoopWaitTimeout;
while (!m_carbonLoopReady->wait()) {
if (ARCH->time() > timeout) {
if (Arch::time() > timeout) {
LOG((CLOG_DEBUG "carbon loop not ready, waiting again"));
timeout = ARCH->time() + kCarbonLoopWaitTimeout;
timeout = Arch::time() + kCarbonLoopWaitTimeout;
}
}