diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-06-03 11:12:44 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-06-03 11:12:44 +0000 |
commit | 821ecfd895990ab4ea8bb86b361a6ba4980a26d0 (patch) | |
tree | dd9c4b0a01dbf651ca2b30154815dc514f84b489 /cpp/src | |
parent | Added missing define for DEBUG to Make.rules.cs. Disabled FinalizerAssert (diff) | |
download | ice-821ecfd895990ab4ea8bb86b361a6ba4980a26d0.tar.bz2 ice-821ecfd895990ab4ea8bb86b361a6ba4980a26d0.tar.xz ice-821ecfd895990ab4ea8bb86b361a6ba4980a26d0.zip |
Fixed bug where shutdown() call on the process proxy would hang
indefinitely.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IcePack/Activator.cpp | 27 | ||||
-rw-r--r-- | cpp/src/IcePack/ServerI.cpp | 8 |
2 files changed, 32 insertions, 3 deletions
diff --git a/cpp/src/IcePack/Activator.cpp b/cpp/src/IcePack/Activator.cpp index 6467909ccd5..4250241ce0b 100644 --- a/cpp/src/IcePack/Activator.cpp +++ b/cpp/src/IcePack/Activator.cpp @@ -46,6 +46,31 @@ private: Activator& _activator; }; +class ProcessShutdownCB : public AMI_Process_shutdown +{ +public: + + ProcessShutdownCB(const ActivatorPtr& activator, const string& name) : _activator(activator), _name(name) + { + } + + virtual void + ice_response() + { + } + + virtual void + ice_exception(const Ice::Exception&) + { + _activator->deactivate(_name, 0); + } + +private: + + const ActivatorPtr _activator; + const string _name; +}; + } #define ICE_STRING(X) #X @@ -768,7 +793,7 @@ Activator::deactivate(const string& name, const Ice::ProcessPrx& process) } try { - process->shutdown(); + process->shutdown_async(new ProcessShutdownCB(this, name)); return; } catch(const Ice::LocalException& ex) diff --git a/cpp/src/IcePack/ServerI.cpp b/cpp/src/IcePack/ServerI.cpp index f043a12c2fb..d661d32e98c 100644 --- a/cpp/src/IcePack/ServerI.cpp +++ b/cpp/src/IcePack/ServerI.cpp @@ -653,7 +653,7 @@ void ServerI::setProcess(const ::Ice::ProcessPrx& proc, const ::Ice::Current&) { IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); - _process = proc; + _process = Ice::ProcessPrx::uncheckedCast(proc->ice_timeout(_waitTime)); notifyAll(); } @@ -679,7 +679,11 @@ ServerI::stopInternal(const Ice::Current& current) // // Wait for the process to be set. // - wait(); // TODO: timeout? + bool notify = timedWait(IceUtil::Time::seconds(_waitTime)); + if(!notify) + { + break; + } } } process = _process; |