mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
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
This commit is contained in:
@@ -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
|
||||
/// <returns>True if the key was found, otherwise false</returns>
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return m_dict.ContainsKey(key);
|
||||
lock (m_syncRoot)
|
||||
return m_dict.ContainsKey(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user