zoukankan      html  css  js  c++  java
  • 多线程 GetThreadValue(int nSlot)问题

    inline void* CThreadSlotData::GetThreadValue(int nSlot){ EnterCriticalSection(&m_sect); ASSERT(nSlot != 0 && nSlot < m_nMax); ASSERT(m_pSlotData != NULL); ASSERT(m_pSlotData[nSlot].dwFlags & SLOT_USED); ASSERT(m_tlsIndex != (DWORD)-1); if( nSlot <= 0 || nSlot >= m_nMax ) // check for retail builds. { LeaveCriticalSection(&m_sect); return NULL; }
    CThreadData* pData = (CThreadData*)TlsGetValue(m_tlsIndex); if (pData == NULL || nSlot >= pData->nCount) { LeaveCriticalSection(&m_sect); return NULL; } void* pRetVal = pData->pData[nSlot]; LeaveCriticalSection(&m_sect); return pRetVal;}

    线程跑到return pRetVal;就中断掉了  不知道该怎么样调试

  • 相关阅读:
    Git
    Git
    Git
    Git
    Docker
    Linux
    Linux
    Python
    Python
    SQL
  • 原文地址:https://www.cnblogs.com/qwcbeyond/p/2051998.html
Copyright © 2011-2022 走看看