当前位置: 首页>>代码示例>>C++>>正文


C++ Thread::GetReadyForSuspensionCount方法代码示例

本文整理汇总了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();
    }
}
开发者ID:ArildF,项目名称:masters,代码行数:15,代码来源:crst.cpp

示例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());
	}
}
开发者ID:ArildF,项目名称:masters,代码行数:16,代码来源:spinlock.cpp

示例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());
	}
}
开发者ID:ArildF,项目名称:masters,代码行数:21,代码来源:spinlock.cpp

示例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");
            }
        }
    }
}
开发者ID:ArildF,项目名称:masters,代码行数:39,代码来源:crst.cpp


注:本文中的Thread::GetReadyForSuspensionCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。