summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/SessionManager.h
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-09-22 14:30:53 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-09-22 14:30:53 +0000
commit059ea645ef16d220ff93cc2f6fd2316974d86a3b (patch)
treeb724aa212cbb5e102645b6abbb10f1ce08b430f3 /cpp/src/IceGrid/SessionManager.h
parentfix version retrieval to sync with change to config/Make.rules (diff)
downloadice-059ea645ef16d220ff93cc2f6fd2316974d86a3b.tar.bz2
ice-059ea645ef16d220ff93cc2f6fd2316974d86a3b.tar.xz
ice-059ea645ef16d220ff93cc2f6fd2316974d86a3b.zip
Node proxies are now stored in a separate non-replicated map.
Diffstat (limited to 'cpp/src/IceGrid/SessionManager.h')
-rw-r--r--cpp/src/IceGrid/SessionManager.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/cpp/src/IceGrid/SessionManager.h b/cpp/src/IceGrid/SessionManager.h
index ea656dccb42..eb96c868265 100644
--- a/cpp/src/IceGrid/SessionManager.h
+++ b/cpp/src/IceGrid/SessionManager.h
@@ -36,7 +36,8 @@ public:
SessionKeepAliveThread(const FPrx& factory) :
_factory(factory),
- _state(Disconnected)
+ _state(Disconnected),
+ _destroySession(false)
{
}
@@ -117,8 +118,11 @@ public:
//
{
Lock sync(*this);
-
- if(_state == Connected || _state == Disconnected)
+ if(_state == Destroyed)
+ {
+ break;
+ }
+ else if(_state == Connected || _state == Disconnected)
{
timedWait(timeout);
}
@@ -127,8 +131,7 @@ public:
{
break;
}
-
- if(_state == DestroySession && session)
+ else if(_state == DestroySession && session)
{
destroy = true;
}
@@ -149,7 +152,7 @@ public:
//
// Destroy the session.
//
- if(session)
+ if(_destroySession && session)
{
destroySession(session);
}
@@ -207,10 +210,12 @@ public:
}
void
- terminate()
+ terminate(bool destroySession = true)
{
Lock sync(*this);
+ assert(_state != Destroyed);
_state = Destroyed;
+ _destroySession = destroySession;
notifyAll();
}
@@ -230,6 +235,7 @@ protected:
FPrx _factory;
TPrx _session;
State _state;
+ bool _destroySession;
};
};