diff options
author | Bernard Normier <bernard@zeroc.com> | 2020-02-12 11:44:39 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2020-02-12 11:44:39 -0500 |
commit | 758d2df9c1a78bf172d46f0a40db816a881a28a9 (patch) | |
tree | a5a9667819060915fb8aba4173563b06fa8fbcae | |
parent | Fixed MATLAB test bug. (See #704) (diff) | |
download | ice-758d2df9c1a78bf172d46f0a40db816a881a28a9.tar.bz2 ice-758d2df9c1a78bf172d46f0a40db816a881a28a9.tar.xz ice-758d2df9c1a78bf172d46f0a40db816a881a28a9.zip |
Added missing synchronization in GetHashCode
-rw-r--r-- | csharp/src/Ice/IPEndpointI.cs | 15 |
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) |