CEncoderThread::~CEncoderThread() { CSingleLock(&m_Mutex,TRUE); if (m_Task=NULL) { } }
void LogFile::CloseLog() { if (! lpCS) return; CSingleLock (lpCS, TRUE); if (fLog) { fclose (fLog); fLog = 0; } }
void CLibraryTileView::clear() { CSingleLock( &Library.m_pSection, TRUE ); // Free pointers (Not using Boost::ptr_list) for ( iterator iter = m_oList.begin(); iter != m_oList.end(); iter++ ) delete *iter; m_oList.clear(); m_nScroll = 0; m_nSelected = 0; m_pFocus = end(); m_pFirst = end(); m_oSelTile.clear(); SelClear(); }
//------------------------------------------------------------------* HRESULT COPCConnection::ReleaseConnection(COPCConnection *pConnection, CItem *pItem) { CSingleLock(&sm_guardConnectionMap, TRUE); if (pConnection == NULL || pItem == NULL) return E_POINTER; CString strKey = pConnection->m_sMachineName; strKey.MakeLower(); COPCConnection *pConn = NULL; sm_connectionMap.Lookup(strKey, pConn); _ASSERTE(pConn == pConnection); if (pConn != pConnection) return E_FAIL; pConnection->RemoveItem(pItem); if (pConnection->IsEmpty()) { pConnection->StopThread(); sm_connectionMap.RemoveKey(strKey); pConnection->Release(); } return S_OK; }
//------------------------------------------------------------------* HRESULT COPCConnection::LookupConnection(LPCTSTR strMachineName, CItem *pItem, COPCConnection**ppConnection) { CSingleLock(&sm_guardConnectionMap, TRUE); if (pItem == NULL || ppConnection == NULL) return E_POINTER; *ppConnection = NULL; CString strKey = strMachineName; strKey.MakeLower(); if (!sm_connectionMap.Lookup(strKey, *ppConnection)) { CComObject<COPCConnection> *pNewConn = NULL; HRESULT hr = CComObject<COPCConnection>::CreateInstance(&pNewConn); if (FAILED(hr)) return hr; *ppConnection = pNewConn; (*ppConnection)->AddRef(); (*ppConnection)->m_sMachineName = strMachineName; sm_connectionMap.SetAt(strKey, *ppConnection); (*ppConnection)->StartThread(); } (*ppConnection)->AddRef(); (*ppConnection)->AddItem(pItem); return S_OK; }
void Rack::SavePingResponse(PingResponse* pr) { CSingleLock(&m_ping_vector_lock,TRUE); mv_ping_responses.Add(pr); }
// Pend until the test has completed ActiveTest::~ActiveTest() { CSingleLock( &m_runCompleted, TRUE ); m_test = NULL; }