From 1e6317134c769a333c2d653d18c444b7f03c7249 Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Tue, 28 Apr 2009 13:47:42 -0230 Subject: Bug 2558 - thread pool tracing --- cpp/src/Ice/ThreadPool.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cpp/src/Ice/ThreadPool.cpp') diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 11c08dc63a9..70bc4513bd4 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -18,6 +18,7 @@ #include #include #include +#include using namespace std; using namespace Ice; @@ -89,6 +90,13 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p } const_cast(_stackSize) = static_cast(stackSize); + if(_instance->traceLevels()->threadPool >= 1) + { + Trace out(_instance->initializationData().logger, _instance->traceLevels()->threadPoolCat); + out << "creating " << _prefix << ": Size = " << _size << ", SizeMax = " << _sizeMax << ", SizeWarn = " + << _sizeWarn; + } + __setNoDelete(true); try { @@ -246,6 +254,12 @@ IceInternal::ThreadPool::promoteFollower(EventHandler* handler) assert(_inUse <= _running); if(_inUse < _sizeMax && _inUse == _running) { + if(_instance->traceLevels()->threadPool >= 1) + { + Trace out(_instance->initializationData().logger, _instance->traceLevels()->threadPoolCat); + out << "growing " << _prefix << ": Size = " << (_running + 1); + } + try { IceUtil::ThreadPtr thread = new EventHandlerThread(this); @@ -615,6 +629,13 @@ IceInternal::ThreadPool::run() // if(load + 1 < _running) { + if(_instance->traceLevels()->threadPool >= 1) + { + Trace out(_instance->initializationData().logger, + _instance->traceLevels()->threadPoolCat); + out << "shrinking " << _prefix << ": Size = " << (_running - 1); + } + assert(_inUse > 0); --_inUse; -- cgit v1.2.3