本文整理汇总了C++中Thread::GetReadyForSuspensionCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Thread::GetReadyForSuspensionCount方法的具体用法?C++ Thread::GetReadyForSuspensionCount怎么用?C++ Thread::GetReadyForSuspensionCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thread
的用法示例。
在下文中一共展示了Thread::GetReadyForSuspensionCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PostEnter
void CrstBase::PostEnter()
{
if (g_pThreadStore->IsCrstForThreadStore(this))
return;
Thread* pThread = GetThread();
if (pThread)
{
if (!m_heldInSuspension)
m_ulReadyForSuspensionCount =
pThread->GetReadyForSuspensionCount();
if (!m_enterInCoopGCMode)
m_enterInCoopGCMode = pThread->PreemptiveGCDisabled();
}
}
示例2: dbg_EnterLock
void SpinLock::dbg_EnterLock()
{
Thread *pThread = GetThread();
if (pThread)
{
if (!m_heldInSuspension)
m_ulReadyForSuspensionCount =
pThread->GetReadyForSuspensionCount();
if (!m_enterInCoopGCMode)
m_enterInCoopGCMode = (pThread->PreemptiveGCDisabled() == TRUE);
}
else
{
_ASSERTE(g_fProcessDetach == TRUE || dbgOnly_IsSpecialEEThread());
}
}
示例3: dbg_LeaveLock
void SpinLock::dbg_LeaveLock()
{
Thread *pThread = GetThread();
if (pThread)
{
if (!m_heldInSuspension &&
m_ulReadyForSuspensionCount !=
pThread->GetReadyForSuspensionCount())
{
m_heldInSuspension = TRUE;
}
if (m_heldInSuspension && m_enterInCoopGCMode)
{
_ASSERTE (!"Deadlock situation 2: lock may be held during GC, but were not entered in PreemptiveGC mode earlier");
}
}
else
{
_ASSERTE(g_fProcessDetach == TRUE || dbgOnly_IsSpecialEEThread());
}
}
示例4: PreLeave
void CrstBase::PreLeave()
{
if (g_pThreadStore->IsCrstForThreadStore(this))
return;
Thread* pThread = GetThread();
if (pThread)
{
if (!m_heldInSuspension &&
m_ulReadyForSuspensionCount !=
pThread->GetReadyForSuspensionCount())
{
m_heldInSuspension = TRUE;
}
if (m_heldInSuspension && m_enterInCoopGCMode)
{
// The GC thread calls into the handle table to scan handles. Sometimes
// the GC thread is a random application thread that is provoking a GC.
// Sometimes the GC thread is a secret GC thread (server or concurrent).
// This can happen if a DllMain notification executes managed code, as in
// an IJW scenario. In the case of the secret thread, we will take this
// lock in preemptive mode.
//
// Normally this would be a dangerous combination. But, in the case of
// this particular Crst, we only ever take the critical section on a thread
// which is identified as the GC thread and which is therefore not subject
// to GC suspensions.
//
// The easiest way to handle this is to weaken the assert for this precise
// case. The alternative would be to have a notion of locks that are
// only ever taken by threads identified as the GC thread.
if (m_crstlevel != CrstHandleTable ||
pThread != g_pGCHeap->GetGCThread())
{
_ASSERTE (!"Deadlock situation 2: lock may be held during GC, but were not entered in PreemptiveGC mode earlier");
}
}
}
}