summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-06-19 12:18:11 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-06-19 12:18:11 +0200
commit7590d75779864d3117de0fe7a775376742a670eb (patch)
tree0d0428841fc4449721ee1a9b469b6fe16bf3665b /cpp
parentFixed release notes link (diff)
downloadice-7590d75779864d3117de0fe7a775376742a670eb.tar.bz2
ice-7590d75779864d3117de0fe7a775376742a670eb.tar.xz
ice-7590d75779864d3117de0fe7a775376742a670eb.zip
Fixed ICE-6595: Glacier2/sessionHelper deadlock on destroy
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/Glacier2Lib/SessionHelper.cpp7
-rw-r--r--cpp/test/Glacier2/sessionHelper/Client.cpp5
2 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp
index 3857289a6c8..68b01fc1cf5 100644
--- a/cpp/src/Glacier2Lib/SessionHelper.cpp
+++ b/cpp/src/Glacier2Lib/SessionHelper.cpp
@@ -864,7 +864,12 @@ Glacier2::SessionFactoryHelper::SessionFactoryHelper(const Ice::PropertiesPtr& p
Glacier2::SessionFactoryHelper::~SessionFactoryHelper()
{
- destroy();
+ IceUtil::Mutex::Lock sync(_mutex);
+ if(!_threads.empty() && Ice::getProcessLogger())
+ {
+ Ice::Warning warn(Ice::getProcessLogger());
+ warn << "Glacier2::SessionFactoryHelper::destroy() has not been called, threads won't be joined";
+ }
}
void
diff --git a/cpp/test/Glacier2/sessionHelper/Client.cpp b/cpp/test/Glacier2/sessionHelper/Client.cpp
index 19bf1e53efb..f61962cd4c1 100644
--- a/cpp/test/Glacier2/sessionHelper/Client.cpp
+++ b/cpp/test/Glacier2/sessionHelper/Client.cpp
@@ -258,6 +258,7 @@ public:
//
_monitor.wait();
}
+ _factory->destroy();
_initData.properties->setProperty("Ice.Default.Router", "");
_factory = new Glacier2::SessionFactoryHelper(_initData, new SuccessSessionCallback());
@@ -409,6 +410,8 @@ public:
}
}
+ _factory->destroy();
+
_factory = new Glacier2::SessionFactoryHelper(_initData, new AfterShutdownSessionCallback());
//
@@ -451,6 +454,8 @@ public:
cout << "ok" << endl;
}
+ _factory->destroy();
+
if(dispatcher)
{
dispatcher->destroy();