LONG prevCount = FastInterlockCompareExchange(&m_outstandingThreadRequestCount, count+1, count);
if (prevCount == count)
{
- if (!CLRThreadpoolHosted())
- {
- ThreadpoolMgr::MaybeAddWorkingWorker();
- ThreadpoolMgr::EnsureGateThreadRunning();
- }
+ ThreadpoolMgr::MaybeAddWorkingWorker();
+ ThreadpoolMgr::EnsureGateThreadRunning();
break;
}
count = prevCount;
LONG prev = FastInterlockCompareExchange(&m_numRequestsPending, count+1, count);
if (prev == count)
{
- if (!CLRThreadpoolHosted())
- {
- ThreadpoolMgr::MaybeAddWorkingWorker();
- ThreadpoolMgr::EnsureGateThreadRunning();
- }
+ ThreadpoolMgr::MaybeAddWorkingWorker();
+ ThreadpoolMgr::EnsureGateThreadRunning();
break;
}
count = prev;
// AD.
//
VolatileStore(&m_numRequestsPending, (LONG)ThreadpoolMgr::NumberOfProcessors);
- if (!CLRThreadpoolHosted() && ThreadpoolMgr::IsInitialized())
+ if (ThreadpoolMgr::IsInitialized())
{
ThreadpoolMgr::MaybeAddWorkingWorker();
ThreadpoolMgr::EnsureGateThreadRunning();
bool ThreadpoolMgr::ShouldWorkerKeepRunning()
{
WRAPPER_NO_CONTRACT;
- if (CLRThreadpoolHosted())
- return true;
//
// Maybe this thread should retire now. Let's see.
}
CONTRACTL_END;
- _ASSERTE(!CLRThreadpoolHosted());
_ASSERTE(ThreadAdjustmentLock.IsHeld());
DWORD currentTicks = GetTickCount();
}
CONTRACTL_END;
- _ASSERTE(!CLRThreadpoolHosted());
-
// counts volatile read paired with CompareExchangeCounts loop set
ThreadCounter::Counts counts = WorkerCounter.DangerousGetDirtyCounts();
ThreadCounter::Counts newCounts;
LIMITED_METHOD_CONTRACT;
// The gate thread is only needed if the CLR is providing part of the ThreadPool implementation.
- _ASSERTE(!CLRThreadpoolHosted() || !CLRIoCompletionHosted());
+ _ASSERTE(!CLRIoCompletionHosted());
while (true)
{
LIMITED_METHOD_CONTRACT;
// The gate thread is only needed if the CLR is providing part of the ThreadPool implementation.
- _ASSERTE(!CLRThreadpoolHosted() || !CLRIoCompletionHosted());
+ _ASSERTE(!CLRIoCompletionHosted());
_ASSERTE(GateThreadStatus == GATE_THREAD_STATUS_WAITING_FOR_REQUEST ||
GateThreadStatus == GATE_THREAD_STATUS_REQUESTED);
// Are there any work requests in any worker queue? If so, we need a gate thread.
// This imples that whenever a work queue goes from empty to non-empty, we need to call EnsureGateThreadRunning().
//
- bool needGateThreadForWorkerThreads =
- !CLRThreadpoolHosted() &&
+ bool needGateThreadForWorkerThreads =
PerAppDomainTPCountList::AreRequestsPendingInAnyAppDomains();
//
}
CONTRACTL_END;
- _ASSERTE(!CLRThreadpoolHosted());
-
Thread *pThread = NULL;
DWORD dwSwitchCount = 0;
BOOL fThreadInit = FALSE;
LIMITED_METHOD_CONTRACT;
// The gate thread is only needed if the CLR is providing part of the ThreadPool implementation.
- _ASSERTE(!CLRThreadpoolHosted() || !CLRIoCompletionHosted());
+ _ASSERTE(!CLRIoCompletionHosted());
HANDLE threadHandle = Thread::CreateUtilityThread(Thread::StackSize_Small, GateThreadStart, NULL);
CONTRACTL_END;
// The gate thread is only needed if the CLR is providing part of the ThreadPool implementation.
- _ASSERTE(!CLRThreadpoolHosted() || !CLRIoCompletionHosted());
+ _ASSERTE(!CLRIoCompletionHosted());
_ASSERTE(GateThreadStatus == GATE_THREAD_STATUS_REQUESTED);
}
#endif // !FEATURE_PAL
- if (!CLRThreadpoolHosted() &&
- (0 == CLRConfig::GetConfigValue(CLRConfig::INTERNAL_ThreadPool_DisableStarvationDetection)))
+ if (0 == CLRConfig::GetConfigValue(CLRConfig::INTERNAL_ThreadPool_DisableStarvationDetection))
{
if (PerAppDomainTPCountList::AreRequestsPendingInAnyAppDomains() && SufficientDelaySinceLastDequeue())
{
static void NotifyWorkItemCompleted()
{
WRAPPER_NO_CONTRACT;
- if (!CLRThreadpoolHosted())
- {
- Thread::IncrementThreadPoolCompletionCount();
- UpdateLastDequeueTime();
- }
+ Thread::IncrementThreadPoolCompletionCount();
+ UpdateLastDequeueTime();
}
static bool ShouldAdjustMaxWorkersActive()
{
WRAPPER_NO_CONTRACT;
- if (CLRThreadpoolHosted())
- return false;
-
DWORD priorTime = PriorCompletedWorkRequestsTime;
MemoryBarrier(); // read fresh value for NextCompletedWorkRequestsTime below
DWORD requiredInterval = NextCompletedWorkRequestsTime - priorTime;