(file) Return to ThreadPool.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/ThreadPool.cpp between version 1.14 and 1.15

version 1.14, 2007/06/05 08:16:41 version 1.15, 2008/06/19 17:57:01
Line 95 
Line 95 
         // Set the dying flag so all thread know the destructor has been         // Set the dying flag so all thread know the destructor has been
         // entered         // entered
         _dying++;         _dying++;
         PEG_TRACE((TRC_THREAD, Tracer::LEVEL2,          PEG_TRACE((TRC_THREAD, Tracer::LEVEL3,
             "Cleaning up %d idle threads.", _currentThreads.get()));             "Cleaning up %d idle threads.", _currentThreads.get()));
  
         while (_currentThreads.get() > 0)         while (_currentThreads.get() > 0)
Line 150 
Line 150 
         }         }
         catch (...)         catch (...)
         {         {
             PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,              PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                 "ThreadPool::_loop: Failure getting sleep_sem or "                 "ThreadPool::_loop: Failure getting sleep_sem or "
                     "lastActivityTime.");                     "lastActivityTime.");
             PEGASUS_ASSERT(false);             PEGASUS_ASSERT(false);
Line 168 
Line 168 
             }             }
             catch (...)             catch (...)
             {             {
                 PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     "ThreadPool::_loop: failure on sleep_sem->wait().");                     "ThreadPool::_loop: failure on sleep_sem->wait().");
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
                 pool->_idleThreads.remove(myself);                 pool->_idleThreads.remove(myself);
Line 197 
Line 197 
             }             }
             catch (...)             catch (...)
             {             {
                 PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     "ThreadPool::_loop: Failure accessing work func, work "                     "ThreadPool::_loop: Failure accessing work func, work "
                         "parm, or blocking sem.");                         "parm, or blocking sem.");
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
Line 227 
Line 227 
             }             }
             catch (Exception& e)             catch (Exception& e)
             {             {
                 PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     String("Exception from work in ThreadPool::_loop: ") +                     String("Exception from work in ThreadPool::_loop: ") +
                         e.getMessage());                         e.getMessage());
             }             }
             catch (const exception& e)             catch (const exception& e)
             {             {
                 PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     String("Exception from work in ThreadPool::_loop: ") +                     String("Exception from work in ThreadPool::_loop: ") +
                         e.what());                         e.what());
             }             }
             catch (...)             catch (...)
             {             {
                 PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     "Unknown exception from work in ThreadPool::_loop.");                     "Unknown exception from work in ThreadPool::_loop.");
             }             }
  
Line 257 
Line 257 
             }             }
             catch (...)             catch (...)
             {             {
                 PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,                  PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                     "ThreadPool::_loop: Adding thread to idle pool failed.");                     "ThreadPool::_loop: Adding thread to idle pool failed.");
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
                 pool->_currentThreads--;                 pool->_currentThreads--;
Line 268 
Line 268 
     }     }
     catch (const Exception & e)     catch (const Exception & e)
     {     {
         PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,          PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
             "Caught exception: \"" + e.getMessage() + "\".  Exiting _loop.");             "Caught exception: \"" + e.getMessage() + "\".  Exiting _loop.");
     }     }
     catch (...)     catch (...)
     {     {
         PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,          PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
             "Caught unrecognized exception.  Exiting _loop.");             "Caught unrecognized exception.  Exiting _loop.");
     }     }
  
Line 296 
Line 296 
     {     {
         if (_dying.get())         if (_dying.get())
         {         {
             PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,              PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL3,
                 "ThreadPool::allocate_and_awaken: ThreadPool is dying(1).");                 "ThreadPool::allocate_and_awaken: ThreadPool is dying(1).");
             return PEGASUS_THREAD_UNAVAILABLE;             return PEGASUS_THREAD_UNAVAILABLE;
         }         }
Line 317 
Line 317 
  
         if (th == 0)         if (th == 0)
         {         {
             PEG_TRACE((TRC_THREAD, Tracer::LEVEL2,              PEG_TRACE((TRC_THREAD, Tracer::LEVEL1,
                 "ThreadPool::allocate_and_awaken: Insufficient resources: "                 "ThreadPool::allocate_and_awaken: Insufficient resources: "
                     " pool = %s, running threads = %d, idle threads = %d",                     " pool = %s, running threads = %d, idle threads = %d",
                 _key, _runningThreads.size(), _idleThreads.size()));                 _key, _runningThreads.size(), _idleThreads.size()));
Line 355 
Line 355 
     }     }
     catch (...)     catch (...)
     {     {
         PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,          PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                       "ThreadPool::allocate_and_awaken: Operation Failed.");                       "ThreadPool::allocate_and_awaken: Operation Failed.");
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         // ATTN: Error result has not yet been defined         // ATTN: Error result has not yet been defined
Line 508 
Line 508 
  
     if (th->run() != PEGASUS_THREAD_OK)     if (th->run() != PEGASUS_THREAD_OK)
     {     {
         PEG_TRACE((TRC_THREAD, Tracer::LEVEL2,          PEG_TRACE((TRC_THREAD, Tracer::LEVEL1,
             "Could not create thread. Error code is %d.", errno));             "Could not create thread. Error code is %d.", errno));
         delete th;         delete th;
         return 0;         return 0;
Line 523 
Line 523 
 { {
     if (th == 0)     if (th == 0)
     {     {
         PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,          PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
             "ThreadPool::_addToIdleThreadsQueue: Thread pointer is null.");             "ThreadPool::_addToIdleThreadsQueue: Thread pointer is null.");
         throw NullPointer();         throw NullPointer();
     }     }
Line 534 
Line 534 
     }     }
     catch (...)     catch (...)
     {     {
         PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL2,          PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
             "ThreadPool::_addToIdleThreadsQueue: _idleThreads.insert_front "             "ThreadPool::_addToIdleThreadsQueue: _idleThreads.insert_front "
                 "failed.");                 "failed.");
     }     }


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2