summaryrefslogtreecommitdiff
path: root/csharp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2020-02-12 11:44:39 -0500
committerBernard Normier <bernard@zeroc.com>2020-02-12 11:44:39 -0500
commit758d2df9c1a78bf172d46f0a40db816a881a28a9 (patch)
treea5a9667819060915fb8aba4173563b06fa8fbcae /csharp/src
parentFixed MATLAB test bug. (See #704) (diff)
downloadice-758d2df9c1a78bf172d46f0a40db816a881a28a9.tar.bz2
ice-758d2df9c1a78bf172d46f0a40db816a881a28a9.tar.xz
ice-758d2df9c1a78bf172d46f0a40db816a881a28a9.zip
Added missing synchronization in GetHashCode
Diffstat (limited to 'csharp/src')
-rw-r--r--csharp/src/Ice/IPEndpointI.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/csharp/src/Ice/IPEndpointI.cs b/csharp/src/Ice/IPEndpointI.cs
index d04b5d91d54..3d3c280f6b7 100644
--- a/csharp/src/Ice/IPEndpointI.cs
+++ b/csharp/src/Ice/IPEndpointI.cs
@@ -243,14 +243,17 @@ namespace IceInternal
public override int GetHashCode()
{
- if(!_hashInitialized)
+ lock (this)
{
- _hashValue = 5381;
- HashUtil.hashAdd(ref _hashValue, type());
- hashInit(ref _hashValue);
- _hashInitialized = true;
+ if(!_hashInitialized)
+ {
+ _hashValue = 5381;
+ HashUtil.hashAdd(ref _hashValue, type());
+ hashInit(ref _hashValue);
+ _hashInitialized = true;
+ }
+ return _hashValue;
}
- return _hashValue;
}
public override int CompareTo(EndpointI obj)