diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-08-16 16:03:55 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-08-16 16:47:04 +0200 |
commit | c119f3c50c121764ceb68c1f7a20e0696a62dbfc (patch) | |
tree | 64b7ef158e17d50f59da4a8035e896e192d69d6b /cpp/src/IceGrid/Topics.cpp | |
parent | Fixed bug 2321 (diff) | |
download | ice-c119f3c50c121764ceb68c1f7a20e0696a62dbfc.tar.bz2 ice-c119f3c50c121764ceb68c1f7a20e0696a62dbfc.tar.xz ice-c119f3c50c121764ceb68c1f7a20e0696a62dbfc.zip |
Fixed potential on shutdown deadlock in the IceGrid registry
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()) |