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 /cppe/src/IceE/Reference.cpp | |
parent | Bug 867. (diff) | |
download | ice-17637b2c90916a65a844ab39a0efe7aadc590fdc.tar.bz2 ice-17637b2c90916a65a844ab39a0efe7aadc590fdc.tar.xz ice-17637b2c90916a65a844ab39a0efe7aadc590fdc.zip |
Bug 857.
Diffstat (limited to 'cppe/src/IceE/Reference.cpp')
-rw-r--r-- | cppe/src/IceE/Reference.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp index 26aaa044409..234ec78dd71 100644 --- a/cppe/src/IceE/Reference.cpp +++ b/cppe/src/IceE/Reference.cpp @@ -106,7 +106,7 @@ IceInternal::Reference::changeFacet(const string& newFacet) const Int Reference::hash() const { - IceUtil::Mutex::Lock sync(_hashMutex); + IceUtil::RecMutex::Lock sync(_hashMutex); if(_hashInitialized) { @@ -590,6 +590,11 @@ IceInternal::RoutableReference::changeRouter(const RouterPrx& newRouter) const return r; } +int +IceInternal::RoutableReference::hash() const +{ + return Reference::hash(); +} bool IceInternal::RoutableReference::operator==(const Reference& r) const @@ -1050,6 +1055,23 @@ IceInternal::IndirectReference::getConnection() 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 { |