pThread->HasCriticalRegion() ||
pThread->HasThreadAffinity();
- // Read fenced call
bool shouldAdjustWorkers = ThreadpoolMgr::ShouldAdjustMaxWorkersActive();
//
{
HELPER_METHOD_FRAME_BEGIN_RET_0();
- if (needReset)
- pThread->InternalReset(FALSE, TRUE, TRUE, FALSE);
-
if (shouldAdjustWorkers)
{
ThreadpoolMgr::AdjustMaxWorkersActive();
tal.Release();
}
+ if (needReset)
+ pThread->InternalReset(FALSE, TRUE, TRUE, FALSE);
+
HELPER_METHOD_FRAME_END();
}
}
}
- // Memory fences below writes
- VolatileStore(&PriorCompletedWorkRequests, totalNumCompletions);
+ PriorCompletedWorkRequests = totalNumCompletions;
PriorCompletedWorkRequestsTime = currentTicks;
NextCompletedWorkRequestsTime = currentTicks + ThreadAdjustmentInterval;
CurrentSampleStartTime = endTime;
+ MemoryBarrier();
}
}
if (CLRThreadpoolHosted())
return false;
+ MemoryBarrier();
DWORD priorTime = PriorCompletedWorkRequestsTime;
- DWORD requiredInterval = VolatileLoad(&NextCompletedWorkRequestsTime) - priorTime; // fences above read
+ DWORD requiredInterval = NextCompletedWorkRequestsTime - priorTime; // fences above read
DWORD elapsedInterval = GetTickCount() - priorTime;
if (elapsedInterval >= requiredInterval)
{