summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Reference.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2006-02-21 04:08:40 +0000
committerMichi Henning <michi@zeroc.com>2006-02-21 04:08:40 +0000
commit17637b2c90916a65a844ab39a0efe7aadc590fdc (patch)
treeef5474109fd55f1778f395abc120fa3260148405 /cpp/src/Ice/Reference.cpp
parentBug 867. (diff)
downloadice-17637b2c90916a65a844ab39a0efe7aadc590fdc.tar.bz2
ice-17637b2c90916a65a844ab39a0efe7aadc590fdc.tar.xz
ice-17637b2c90916a65a844ab39a0efe7aadc590fdc.zip
Bug 857.
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 6ebe481ea3f..0a84aced76c 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -118,7 +118,7 @@ IceInternal::Reference::changeEndpointSelection(EndpointSelectionType newType) c
Int
Reference::hash() const
{
- IceUtil::Mutex::Lock sync(_hashMutex);
+ IceUtil::RecMutex::Lock sync(_hashMutex);
if(_hashInitialized)
{
@@ -759,6 +759,12 @@ IceInternal::RoutableReference::changeCollocationOptimization(bool newCollocatio
return r;
}
+int
+IceInternal::RoutableReference::hash() const
+{
+ return Reference::hash();
+}
+
bool
IceInternal::RoutableReference::operator==(const Reference& r) const
{
@@ -1469,6 +1475,23 @@ IceInternal::IndirectReference::getConnection(bool& comp) const
return connection;
}
+int
+IceInternal::IndirectReference::hash() const
+{
+ IceUtil::RecMutex::Lock sync(_hashMutex);
+
+ if(_hashInitialized)
+ {
+ return _hashValue;
+ }
+ RoutableReference::hash(); // Initializes _hashValue.
+ for(string::const_iterator p = _adapterId.begin(); p != _adapterId.end(); ++p) // Add hash of adapter ID to base hash.
+ {
+ _hashValue = 5 * _hashValue + *p;
+ }
+ return _hashValue;
+}
+
bool
IceInternal::IndirectReference::operator==(const Reference& r) const
{