From 2501372d3b7623715d443d41f9d85a5f416ec1b1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 18 Sep 2010 01:57:13 +0100
Subject: 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
---
OpenSim/Framework/MapAndArray.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework/MapAndArray.cs')
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 @@
-/*
+/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@@ -131,7 +131,8 @@ namespace OpenSim.Framework
/// True if the key was found, otherwise false
public bool ContainsKey(TKey key)
{
- return m_dict.ContainsKey(key);
+ lock (m_syncRoot)
+ return m_dict.ContainsKey(key);
}
///
--
cgit v1.1