diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-06-13 14:39:41 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-06-13 14:39:41 +0200 |
commit | c43d26cb98eb2ab48910f96600b9f402a15af499 (patch) | |
tree | fde5db315a9d2da61235938f70c0be38cadc0bf1 /cpp/src | |
parent | Only install zeroc.ice.v140 when ICE_BIN_DIST == cpp (diff) | |
download | ice-c43d26cb98eb2ab48910f96600b9f402a15af499.tar.bz2 ice-c43d26cb98eb2ab48910f96600b9f402a15af499.tar.xz ice-c43d26cb98eb2ab48910f96600b9f402a15af499.zip |
Another fix for ICE-8015 - clearing connections from ACM monitor
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/ACM.cpp | 19 | ||||
-rw-r--r-- | cpp/src/Ice/ACM.h | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/cpp/src/Ice/ACM.cpp b/cpp/src/Ice/ACM.cpp index 9392df6aacc..bb620d07430 100644 --- a/cpp/src/Ice/ACM.cpp +++ b/cpp/src/Ice/ACM.cpp @@ -94,8 +94,26 @@ IceInternal::FactoryACMMonitor::destroy() return; } + // + // Cancel the scheduled timer task and schedule it again now to clear the + // connection set from the timer thread. + // + if(!_connections.empty()) + { + _instance->timer()->cancel(ICE_SHARED_FROM_THIS); + _instance->timer()->schedule(ICE_SHARED_FROM_THIS, IceUtil::Time()); + } + _instance = 0; _changes.clear(); + + // + // Wait for the connection set to be cleared by the timer thread. + // + while(!_connections.empty()) + { + wait(); + } } void @@ -187,6 +205,7 @@ IceInternal::FactoryACMMonitor::runTimerTask() if(!_instance) { _connections.clear(); + notify(); return; } diff --git a/cpp/src/Ice/ACM.h b/cpp/src/Ice/ACM.h index 169efd984db..77ca93a121a 100644 --- a/cpp/src/Ice/ACM.h +++ b/cpp/src/Ice/ACM.h @@ -50,7 +50,7 @@ public: virtual Ice::ACM getACM() = 0; }; -class FactoryACMMonitor : public ACMMonitor, public IceUtil::Mutex +class FactoryACMMonitor : public ACMMonitor, public IceUtil::Monitor<IceUtil::Mutex> #ifdef ICE_CPP11_MAPPING , public std::enable_shared_from_this<FactoryACMMonitor> #endif |