summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Util.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2010-02-19 18:45:14 +0100
committerBenoit Foucher <benoit@zeroc.com>2010-02-19 18:45:14 +0100
commitea9a8bcfc079175205766491ab217e65536a656f (patch)
tree8dd6cd069f9966bd59d72587052a42195d45cf63 /cpp/src/IceGrid/Util.cpp
parentadded txt to ICE_LICENSE (diff)
downloadice-ea9a8bcfc079175205766491ab217e65536a656f.tar.bz2
ice-ea9a8bcfc079175205766491ab217e65536a656f.tar.xz
ice-ea9a8bcfc079175205766491ab217e65536a656f.zip
Fixed bug 4677 - IceGrid update hang
Diffstat (limited to 'cpp/src/IceGrid/Util.cpp')
-rw-r--r--cpp/src/IceGrid/Util.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp
index 8fe7baf5a04..78c1c04aab0 100644
--- a/cpp/src/IceGrid/Util.cpp
+++ b/cpp/src/IceGrid/Util.cpp
@@ -11,10 +11,19 @@
#include <IcePatch2/Util.h>
#include <IceGrid/Util.h>
#include <IceGrid/Admin.h>
+#include <IceGrid/Internal.h>
using namespace std;
+using namespace Ice;
using namespace IceGrid;
+void
+IceGrid::SynchronizationException::ice_print(ostream& out) const
+{
+ Exception::ice_print(out);
+ out << ":\nsynchronization exception";
+}
+
string
IceGrid::toString(const vector<string>& v, const string& sep)
{
@@ -129,6 +138,38 @@ IceGrid::escapeProperty(const string& s)
return result;
}
+void
+IceGrid::setupThreadPool(const PropertiesPtr& properties, const string& name, int size, int sizeMax, bool serialize)
+{
+ if(properties->getPropertyAsIntWithDefault(name + ".Size", 0) < size)
+ {
+ ostringstream os;
+ os << size;
+ properties->setProperty(name + ".Size", os.str());
+ }
+ else
+ {
+ size = properties->getPropertyAsInt(name + ".Size");
+ }
+
+ if(sizeMax > 0 && properties->getPropertyAsIntWithDefault(name + ".SizeMax", 0) < sizeMax)
+ {
+ if(size >= sizeMax)
+ {
+ sizeMax = size * 10;
+ }
+
+ ostringstream os;
+ os << sizeMax;
+ properties->setProperty(name + ".SizeMax", os.str());
+ }
+
+ if(serialize)
+ {
+ properties->setProperty(name + ".Serialize", "1");
+ }
+}
+
int
IceGrid::getMMVersion(const string& o)
{