STREAM::~STREAM(void) { ASSERT(uNumStreams); if (hstream) { int3(); DeRegister(); } uNumStreams--; }
void CDlgAutoRegister::Run3() { ResetEvent(m_hEventTheadNoRun3); ::CoInitialize(NULL); while(1) { try { int nCount = 0; m_cs.Lock(); nCount = (int)m_arrDeRegisterNode.size(); m_cs.Unlock(); if (nCount > 0) { for (int i = 0; i < nCount; i++) { m_cs.Lock(); DeRegisterNode& node = m_arrDeRegisterNode[i]; m_cs.Unlock(); if(0 == node.bInvalid) { if(node.OldDeRegisterTime < COleDateTime::GetCurrentTime()) { DeRegister(node); m_cs.Lock(); node.bInvalid = 1; m_cs.Unlock(); } } SleepThread(1, 3); } } } catch(...) { IBA_LOG0(_T("出现异常3")); } SleepThread(1 * 60, 3); // 一分钟检测一次 } SetEvent(m_hEventTheadNoRun3); }