locking issue

LSLKeyTest
UbitUmarov 2016-08-22 07:55:25 +01:00
parent d1e3be1efe
commit 9229d5a324
1 changed files with 5 additions and 4 deletions

View File

@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private object MAOLock = new object();
private Dictionary<string, UUID> m_overrides = new Dictionary<string, UUID>(); private Dictionary<string, UUID> m_overrides = new Dictionary<string, UUID>();
public void SetOverride(string state, UUID animID) public void SetOverride(string state, UUID animID)
{ {
@ -66,13 +67,13 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("Setting override for {0} to {1}", state, animID); m_log.DebugFormat("Setting override for {0} to {1}", state, animID);
lock (m_overrides) lock (MAOLock)
m_overrides[state] = animID; m_overrides[state] = animID;
} }
public UUID GetOverriddenAnimation(string state) public UUID GetOverriddenAnimation(string state)
{ {
lock (m_overrides) lock (MAOLock)
{ {
if (m_overrides.ContainsKey(state)) if (m_overrides.ContainsKey(state))
return m_overrides[state]; return m_overrides[state];
@ -83,7 +84,7 @@ namespace OpenSim.Region.Framework.Scenes
public Dictionary<string, UUID> CloneAOPairs() public Dictionary<string, UUID> CloneAOPairs()
{ {
lock (m_overrides) lock (MAOLock)
{ {
return new Dictionary<string, UUID>(m_overrides); return new Dictionary<string, UUID>(m_overrides);
} }
@ -91,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes
public void CopyAOPairsFrom(Dictionary<string, UUID> src) public void CopyAOPairsFrom(Dictionary<string, UUID> src)
{ {
lock (m_overrides) lock (MAOLock)
{ {
m_overrides.Clear(); m_overrides.Clear();
m_overrides = new Dictionary<string, UUID>(src); m_overrides = new Dictionary<string, UUID>(src);