HRESULT CLRTestHookManager::AddTestHook(ICLRTestHook* hook) { WRAPPER_NO_CONTRACT; DWORD newidx=FastInterlockIncrement(&m_nHooks); if (newidx>=NumItems(m_pHooks)) { FastInterlockDecrement(&m_nHooks); return DISP_E_OVERFLOW; } m_pHooks[newidx-1].Set(hook); return S_OK; }
void CNameSpace::GcRuntimeStructuresValid (BOOL bValid) { WRAPPER_NO_CONTRACT; if (!bValid) { LONG result; result = FastInterlockIncrement (&m_GcStructuresInvalidCnt); _ASSERTE (result > 0); } else { LONG result; result = FastInterlockDecrement (&m_GcStructuresInvalidCnt); _ASSERTE (result >= 0); } }
ULONG CLRTestHookManager::Release() { ULONG nRet= FastInterlockDecrement(&m_cRef); // never goes away return nRet; }