diff options
author | Matthew Newhook <matthew@zeroc.com> | 2007-01-16 10:37:23 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2007-01-16 10:37:23 +0000 |
commit | 8bccaa84b6b2c204608af57e1710028b7d71ff3f (patch) | |
tree | d2385d8753ceb677110d6d8c508a1bac837ef486 /cpp/src/Ice/ConnectionI.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1665 (diff) | |
download | ice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.tar.bz2 ice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.tar.xz ice-8bccaa84b6b2c204608af57e1710028b7d71ff3f.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1179
Diffstat (limited to 'cpp/src/Ice/ConnectionI.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 1597636cea6..9f7dea5d0c2 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -1451,9 +1451,12 @@ Ice::ConnectionI::finished(const ThreadPoolPtr& threadPool) IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); --_finishedCount; + assert(threadPool.get() == _threadPool.get()); if(_finishedCount == 0 && _state == StateClosed) { + _threadPool->decFdsInUse(); + // // We must make sure that nobody is sending when we close // the transceiver. @@ -1606,8 +1609,8 @@ Ice::ConnectionI::ConnectionI(const InstancePtr& instance, } int& compressionLevel = const_cast<int&>(_compressionLevel); - compressionLevel = \ - _instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.Compression.Level", 1); + compressionLevel = _instance->initializationData().properties->getPropertyAsIntWithDefault( + "Ice.Compression.Level", 1); if(compressionLevel < 1) { compressionLevel = 1; @@ -1642,6 +1645,7 @@ Ice::ConnectionI::ConnectionI(const InstancePtr& instance, { const_cast<ThreadPoolPtr&>(_threadPool) = _instance->clientThreadPool(); } + _threadPool->incFdsInUse(); } else { @@ -1671,7 +1675,11 @@ Ice::ConnectionI::ConnectionI(const InstancePtr& instance, { out << "cannot create thread for connection:\n" << ex; } - else + // + // If the _threadPool member variable is set then + // ThreadPool::incFdsInUse() failed. + // + else if(!_threadPool) { out << "cannot create thread pool for connection:\n" << ex; } @@ -1859,6 +1867,8 @@ Ice::ConnectionI::setState(State state) // assert(!_registeredWithPool); + _threadPool->decFdsInUse(); + // // We must make sure that nobody is sending when we // close the transceiver. |