CPoolOfThreads_ForServer::~CPoolOfThreads_ForServer(void) { try { KillAllThreads(false); } catch(...) {} // Just to be sure that we will not throw from the destructor. CAtomicCounter::TValue n = m_ThreadCount.Get(); if (n) { ERR_POST_X(10, Warning << "CPoolOfThreads_ForServer::~CPoolOfThreads_ForServer: " << n << " thread(s) still active"); } // Just in case let's deliberately not destroy all queues. }
CPoolOfThreads_ForServer::~CPoolOfThreads_ForServer(void) { try { KillAllThreads(false); } catch(...) {} // Just to be sure that we will not throw from the destructor. CAtomicCounter::TValue n = m_ThreadCount.Get(); if (n) { ERR_POST_X(10, Warning << "CPoolOfThreads_ForServer::~CPoolOfThreads_ForServer: " << n << " thread(s) still active"); } else { // It seems to be safe to destroy the allocated array if all the // threads were stopped. for (TACValue i = 0; i < m_MaxThreads; ++i) { delete m_Queues[i]; } delete [] (char *)(m_Queues); } // Just in case let's deliberately not destroy all queues. }
CStdPoolOfThreads::~CStdPoolOfThreads() { try { KillAllThreads(0); } catch(...) {} // Just to be sure that we will not throw from the destructor. }