summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/SessionManager.h
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-10-24 10:07:47 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-10-24 10:07:47 +0000
commit7b592e7fe94abf0e8e8e493bb5e83d92f0c5415f (patch)
tree573b60cfabd063723d8d2c4e9f81a4972581a2a6 /cpp/src/IceGrid/SessionManager.h
parentRemoved Properties.sgml and ProxiesEndpoints.sgml. (diff)
downloadice-7b592e7fe94abf0e8e8e493bb5e83d92f0c5415f.tar.bz2
ice-7b592e7fe94abf0e8e8e493bb5e83d92f0c5415f.tar.xz
ice-7b592e7fe94abf0e8e8e493bb5e83d92f0c5415f.zip
Fixed bug where node couldn't be interrupted if master isn't available
Diffstat (limited to 'cpp/src/IceGrid/SessionManager.h')
-rw-r--r--cpp/src/IceGrid/SessionManager.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/SessionManager.h b/cpp/src/IceGrid/SessionManager.h
index 4ac9e488cbc..a1403b0cfba 100644
--- a/cpp/src/IceGrid/SessionManager.h
+++ b/cpp/src/IceGrid/SessionManager.h
@@ -90,7 +90,6 @@ public:
}
notifyAll();
-
//
// Wait if there's nothing to do and if we are
// connected or if we've just tried to connect.
@@ -99,9 +98,10 @@ public:
{
if(_state == Connected || (action == Connect || action == KeepAlive))
{
+ IceUtil::Time wakeTime = IceUtil::Time::now() + timeout;
while(_state != Destroyed && _nextAction == None)
{
- if(!timedWait(timeout))
+ if(!timedWait(wakeTime - IceUtil::Time::now()))
{
break;
}
@@ -219,6 +219,10 @@ public:
terminate(bool destroySession = true)
{
Lock sync(*this);
+ if(_state == Destroyed)
+ {
+ return;
+ }
assert(_state != Destroyed);
_state = Destroyed;
_nextAction = destroySession ? Disconnect : None;