summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-06-19 15:27:45 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-06-19 15:27:45 +0000
commitf661f6a2c43e5698132f1ac88ec4cb046614cecd (patch)
treec7a3e7a0e79c063c83b55a9c05e951693f493a4d /cpp/src/IceGrid/NodeI.cpp
parentfixing an uninitialized boolean issue (diff)
downloadice-f661f6a2c43e5698132f1ac88ec4cb046614cecd.tar.bz2
ice-f661f6a2c43e5698132f1ac88ec4cb046614cecd.tar.xz
ice-f661f6a2c43e5698132f1ac88ec4cb046614cecd.zip
Fixed bug 1092
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r--cpp/src/IceGrid/NodeI.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp
index 4b15ce8e978..c85d579e544 100644
--- a/cpp/src/IceGrid/NodeI.cpp
+++ b/cpp/src/IceGrid/NodeI.cpp
@@ -478,6 +478,12 @@ void
NodeI::shutdown(const Ice::Current&) const
{
_activator->shutdown();
+
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_sessionMonitor);
+ while(_session)
+ {
+ _sessionMonitor.wait();
+ }
}
Ice::CommunicatorPtr
@@ -536,10 +542,7 @@ NodeI::setSession(const NodeSessionPrx& session, const NodeObserverPrx& observer
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_sessionMonitor);
_session = session;
_observer = observer;
- if(_session)
- {
- _sessionMonitor.notifyAll();
- }
+ _sessionMonitor.notifyAll();
}
int
@@ -597,13 +600,12 @@ NodeI::waitForSession()
void
NodeI::stop()
{
- Lock sync(*this);
+ Lock sync(_sessionMonitor);
if(_session)
{
try
{
_session->destroy();
- _session = 0;
}
catch(const Ice::LocalException& ex)
{
@@ -611,6 +613,9 @@ NodeI::stop()
os << "couldn't contact the IceGrid registry to destroy the node session:\n" << ex;
_traceLevels->logger->warning(os.str());
}
+
+ _session = 0;
+ _sessionMonitor.notifyAll();
}
}