Skip to content

Commit

Permalink
fix: Disable sync timer during sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Nov 27, 2024
1 parent 17dcaa2 commit 1b540f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ForgedInvariant/ForgedInvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,15 @@ void ForgedInvariantMain::wrapTracePoint(void *that, UInt8 point) {
case kIOPMTracePointSleepCPUs: // Those CPUs sure like to sleep.
atomic_store_explicit(&singleton().systemAwake, false, memory_order_relaxed);
atomic_store_explicit(&singleton().synchronised, false, memory_order_relaxed);
if (singleton().syncTimer != nullptr) { singleton().syncTimer->disable(); }
break;
case kIOPMTracePointWakePlatformActions: // So now you want to wake up, huh?
atomic_store_explicit(&singleton().systemAwake, true, memory_order_relaxed);
singleton().syncTsc();
if (singleton().syncTimer != nullptr) {
singleton().syncTimer->enable();
singleton().syncTimer->setTimeoutMS(PERIODIC_SYNC_INTERVAL);
}
break;
default: // Don't care. Lol!
break;
Expand Down

0 comments on commit 1b540f1

Please sign in to comment.