diff options
author | Michi Henning <michi@zeroc.com> | 2006-02-21 04:08:40 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2006-02-21 04:08:40 +0000 |
commit | 17637b2c90916a65a844ab39a0efe7aadc590fdc (patch) | |
tree | ef5474109fd55f1778f395abc120fa3260148405 /cpp/src/Ice/Reference.cpp | |
parent | Bug 867. (diff) | |
download | ice-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.cpp | 25 |
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 { |