diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-04-28 13:47:42 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-04-28 13:47:42 -0230 |
commit | 1e6317134c769a333c2d653d18c444b7f03c7249 (patch) | |
tree | aa590e61b6846bc6cf30e6ffd3b50881c0faddf0 /cpp/src/Ice/ThreadPool.cpp | |
parent | Bug 3482 - deprecate generateUUID in C# (diff) | |
download | ice-1e6317134c769a333c2d653d18c444b7f03c7249.tar.bz2 ice-1e6317134c769a333c2d653d18c444b7f03c7249.tar.xz ice-1e6317134c769a333c2d653d18c444b7f03c7249.zip |
Bug 2558 - thread pool tracing
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 <Ice/Protocol.h> #include <Ice/ObjectAdapterFactory.h> #include <Ice/Properties.h> +#include <Ice/TraceLevels.h> using namespace std; using namespace Ice; @@ -89,6 +90,13 @@ IceInternal::ThreadPool::ThreadPool(const InstancePtr& instance, const string& p } const_cast<size_t&>(_stackSize) = static_cast<size_t>(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; |