diff options
author | Justin Clark-Casey (justincc) | 2010-09-18 01:57:13 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-18 01:57:13 +0100 |
commit | 2501372d3b7623715d443d41f9d85a5f416ec1b1 (patch) | |
tree | cfeffa30eaf89dd498521994656c2334212aa069 | |
parent | Stop broadcasting non 0/DEBUG ChatTypeEnum.Region messages to all avatars (diff) | |
download | opensim-SC_OLD-2501372d3b7623715d443d41f9d85a5f416ec1b1.zip opensim-SC_OLD-2501372d3b7623715d443d41f9d85a5f416ec1b1.tar.gz opensim-SC_OLD-2501372d3b7623715d443d41f9d85a5f416ec1b1.tar.bz2 opensim-SC_OLD-2501372d3b7623715d443d41f9d85a5f416ec1b1.tar.xz |
Add m_syncRoot lock to MapAndArray.ContainsKey(), as discussed with jhurliman
Though this is actually thread-safe on .net 4.0 and mono today, the .net sdk states that Dictionary instance members are not guaranteed thread-safe
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/MapAndArray.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Framework/MapAndArray.cs b/OpenSim/Framework/MapAndArray.cs index bbe6a9e..c98d3cc 100644 --- a/OpenSim/Framework/MapAndArray.cs +++ b/OpenSim/Framework/MapAndArray.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -131,7 +131,8 @@ namespace OpenSim.Framework | |||
131 | /// <returns>True if the key was found, otherwise false</returns> | 131 | /// <returns>True if the key was found, otherwise false</returns> |
132 | public bool ContainsKey(TKey key) | 132 | public bool ContainsKey(TKey key) |
133 | { | 133 | { |
134 | return m_dict.ContainsKey(key); | 134 | lock (m_syncRoot) |
135 | return m_dict.ContainsKey(key); | ||
135 | } | 136 | } |
136 | 137 | ||
137 | /// <summary> | 138 | /// <summary> |