diff options
author | Marc Laukien <marc@zeroc.com> | 2004-11-01 23:28:31 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-11-01 23:28:31 +0000 |
commit | 6753182b7c202723ae98fb43fc924fe98395a005 (patch) | |
tree | f95ffa63b4c4e672d3a62a566a5fca0ac0599b72 /cpp/src/Glacier2/Blobject.cpp | |
parent | more glacier2 (diff) | |
download | ice-6753182b7c202723ae98fb43fc924fe98395a005.tar.bz2 ice-6753182b7c202723ae98fb43fc924fe98395a005.tar.xz ice-6753182b7c202723ae98fb43fc924fe98395a005.zip |
fixed out of threads condition handling
Diffstat (limited to 'cpp/src/Glacier2/Blobject.cpp')
-rw-r--r-- | cpp/src/Glacier2/Blobject.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/cpp/src/Glacier2/Blobject.cpp b/cpp/src/Glacier2/Blobject.cpp index 3af5b8db76e..1d9e93bf440 100644 --- a/cpp/src/Glacier2/Blobject.cpp +++ b/cpp/src/Glacier2/Blobject.cpp @@ -49,15 +49,35 @@ Glacier2::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse) { if(!_unbuffered) { - IceUtil::Time sleepTime = _reverse ? - IceUtil::Time::milliSeconds(communicator->getProperties()->getPropertyAsInt(serverSleepTime)) : - IceUtil::Time::milliSeconds(communicator->getProperties()->getPropertyAsInt(clientSleepTime)); - - _requestQueue = new RequestQueue(sleepTime); - - Int threadStackSize = _properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize"); + try + { + IceUtil::Time sleepTime = _reverse ? + IceUtil::Time::milliSeconds(communicator->getProperties()->getPropertyAsInt(serverSleepTime)) : + IceUtil::Time::milliSeconds(communicator->getProperties()->getPropertyAsInt(clientSleepTime)); + + _requestQueue = new RequestQueue(sleepTime); + + Int threadStackSize = _properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize"); + + _requestQueue->start(static_cast<size_t>(threadStackSize)); + } + catch(const IceUtil::Exception& ex) + { + { + Error out(_logger); + out << "cannot create thread for request queue:\n" << ex; + } - _requestQueue->start(static_cast<size_t>(threadStackSize)); + if(_requestQueue) + { + _requestQueue->destroy(); + _requestQueue = 0; + } + + __setNoDelete(false); + throw; + } + __setNoDelete(false); } } |