diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-08-24 11:28:20 -0400 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-08-24 11:28:20 -0400 |
commit | 9a07052d6711858507faa27ff736d4520b3163e9 (patch) | |
tree | 7fa0a0406be0386a8314b2e8c742f29bf127b70d /cpp/src/IceGrid/Topics.cpp | |
parent | Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff) | |
parent | Squashed commit of the following: (diff) | |
download | ice-9a07052d6711858507faa27ff736d4520b3163e9.tar.bz2 ice-9a07052d6711858507faa27ff736d4520b3163e9.tar.xz ice-9a07052d6711858507faa27ff736d4520b3163e9.zip |
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/src/IceGrid/Topics.cpp')
-rw-r--r-- | cpp/src/IceGrid/Topics.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/Topics.cpp b/cpp/src/IceGrid/Topics.cpp index 51da20ee1ad..b9ca04848c0 100644 --- a/cpp/src/IceGrid/Topics.cpp +++ b/cpp/src/IceGrid/Topics.cpp @@ -42,13 +42,13 @@ ObserverTopic::~ObserverTopic() { } -void +int ObserverTopic::subscribe(const Ice::ObjectPrx& obsv, const string& name) { Lock sync(*this); if(!_topic) { - return; + return -1; } assert(obsv); @@ -68,8 +68,9 @@ ObserverTopic::subscribe(const Ice::ObjectPrx& obsv, const string& name) assert(_syncSubscribers.find(name) == _syncSubscribers.end()); _syncSubscribers.insert(name); addExpectedUpdate(_serial, name); - waitForSyncedSubscribersNoSync(_serial, name); + return _serial; } + return -1; } void @@ -183,9 +184,9 @@ ObserverTopic::waitForSyncedSubscribersNoSync(int serial, const string& name) } // - // Wait until all the updates are received. + // Wait until all the updates are received or the service shutdown. // - while(true) + while(_topic) { map<int, set<string> >::const_iterator p = _waitForUpdates.find(serial); if(p == _waitForUpdates.end()) |