diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-03-24 14:32:35 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-03-24 14:32:35 +0000 |
commit | c9a1e3aad627ee02dd5a17b374528f48c9ebe157 (patch) | |
tree | 912ba1a8707db30c1ce7fa6792691e90c824732a /cpp/src/IceGrid/AdapterCache.cpp | |
parent | Fix (diff) | |
download | ice-c9a1e3aad627ee02dd5a17b374528f48c9ebe157.tar.bz2 ice-c9a1e3aad627ee02dd5a17b374528f48c9ebe157.tar.xz ice-c9a1e3aad627ee02dd5a17b374528f48c9ebe157.zip |
Fixed bug 916.
Diffstat (limited to 'cpp/src/IceGrid/AdapterCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/AdapterCache.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index e7df0dd82b2..b6bc81a2014 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -7,6 +7,7 @@ // // ********************************************************************** +#include <IceUtil/Random.h> #include <Ice/LoggerUtil.h> #include <Ice/Locator.h> #include <IceGrid/AdapterCache.h> @@ -337,7 +338,7 @@ ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas) else// if(RandomLoadBalancingPolicyPtr::dynamicCast(_loadBalancing)) { replicas = _replicas; - random_shuffle(replicas.begin(), replicas.end()); + random_shuffle(replicas.begin(), replicas.end(), IceUtil::random); } } @@ -347,7 +348,7 @@ ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas) // This must be done outside the synchronization block since // the sort() will call and lock each server entry. // - random_shuffle(replicas.begin(), replicas.end()); + random_shuffle(replicas.begin(), replicas.end(), IceUtil::random); sort(replicas.begin(), replicas.end(), ServerLoadCI(loadSample)); } @@ -390,7 +391,7 @@ ReplicaGroupEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const // This must be done outside the synchronization block since // min_element() will call and lock each server entry. // - random_shuffle(replicas.begin(), replicas.end()); + random_shuffle(replicas.begin(), replicas.end(), IceUtil::random); AdapterEntryPtr adpt = min_element(replicas.begin(), replicas.end(), ServerLoadCI(loadSample))->second; return adpt->getLeastLoadedNodeLoad(loadSample); } |