[*] Switch to astatic Aurora::Utility::RateLimiter limiter` for gRuntimeConfig.threadingConfig.bWinXpThrough7BlazeOptimizerPower

This commit is contained in:
Reece Wilson 2023-09-10 14:53:54 +01:00
parent 74dc6772b0
commit c6c35a588c

View File

@ -238,7 +238,6 @@ namespace Aurora
void Win32DropSchedulerResolution()
{
static AuUInt uCounter {};
ULONG ullActualResolution {};
if (gShouldResPathDoNothing)
@ -248,21 +247,16 @@ namespace Aurora
if (gRuntimeConfig.threadingConfig.bEnableAgrSchedulingRatelimit)
{
AuUInt uCount {};
if (!(((uCount = uCounter++)) & (1ull << (gRuntimeConfig.threadingConfig.bWinXpThrough7BlazeOptimizerPower + 5ull))))
static Aurora::Utility::RateLimiter limiter;
if (!limiter.nsTimeStep)
{
if (uCount != 0)
limiter.SetNextStep(gRuntimeConfig.threadingConfig.bWinXpThrough7BlazeOptimizerPower);
}
else if (!limiter.CheckExchangePass())
{
return;
}
}
else
{
uCounter = 0;
}
}
if (pZwSetTimerResolution)
{