diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-12-19 22:06:30 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-12-19 22:06:30 +0000 |
commit | fc2fadbfc8a58bd22d9ec2f26c0fc80700bea619 (patch) | |
tree | 5301ea4c763e59cc2b1b07780f61c6d3963fcc1d /cpp/src | |
parent | adding destroy flag (diff) | |
download | ice-fc2fadbfc8a58bd22d9ec2f26c0fc80700bea619.tar.bz2 ice-fc2fadbfc8a58bd22d9ec2f26c0fc80700bea619.tar.xz ice-fc2fadbfc8a58bd22d9ec2f26c0fc80700bea619.zip |
Fixed shutdown problem
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IcePack/IcePackNode.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IcePack/ServerAdapterI.cpp | 30 |
2 files changed, 22 insertions, 16 deletions
diff --git a/cpp/src/IcePack/IcePackNode.cpp b/cpp/src/IcePack/IcePackNode.cpp index 90d4ac25bd9..740ab9888e2 100644 --- a/cpp/src/IcePack/IcePackNode.cpp +++ b/cpp/src/IcePack/IcePackNode.cpp @@ -312,11 +312,15 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, const Free activator->waitForShutdown(); ignoreInterrupt(); - waitQueue->destroy(); - activator->destroy(); // + // The wait queue must be destroyed after the activator and before + // the communicator is shutdown. + // + waitQueue->destroy(); + + // // We can now safelly shutdown the communicator. // communicator->shutdown(); diff --git a/cpp/src/IcePack/ServerAdapterI.cpp b/cpp/src/IcePack/ServerAdapterI.cpp index d0d3366d96e..7ea5a64057f 100644 --- a/cpp/src/IcePack/ServerAdapterI.cpp +++ b/cpp/src/IcePack/ServerAdapterI.cpp @@ -96,7 +96,6 @@ IcePack::ServerAdapterI::getDirectProxy_async(const AMD_Adapter_getDirectProxyPt out << "waiting for activation of server adapter `" << id << "'"; } } - // // Try to start the server. Note that we start the server outside @@ -115,20 +114,8 @@ IcePack::ServerAdapterI::getDirectProxy_async(const AMD_Adapter_getDirectProxyPt if(!_proxy) { _factory->getWaitQueue()->add(new WaitForAdapterActivation(this, _traceLevels, cb), _waitTime); + return; } - return; - } - else - { - ::IceUtil::Mutex::Lock sync(*this); - - if(_traceLevels->adapter > 1) - { - Ice::Trace out(_traceLevels->logger, _traceLevels->adapterCat); - out << "server adapter `" << id << "' activation failed, couldn't start the server"; - } - cb->ice_response(_proxy); - return; } } catch(const Ice::ObjectNotExistException&) @@ -145,6 +132,21 @@ IcePack::ServerAdapterI::getDirectProxy_async(const AMD_Adapter_getDirectProxyPt ex.id = current.id; throw ex; } + + // + // The server couldn't be activated, trace and return the current + // adapter proxy. + // + { + ::IceUtil::Mutex::Lock sync(*this); + if(_traceLevels->adapter > 1) + { + Ice::Trace out(_traceLevels->logger, _traceLevels->adapterCat); + out << "server adapter `" << id << "' activation failed, couldn't start the server"; + } + + cb->ice_response(_proxy); + } } void |