From 2e47e5147547d355d8935404c43fbe1b61888ee1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Nov 2009 19:01:45 +0000 Subject: Make locking of timers and listeners in script related functions consistent See http://opensimulator.org/mantis/view.php?id=4316 Thanks KittyLiu! --- .../Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index d4a28e2..60df2e7 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -602,9 +602,12 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm ListenerInfo info = ListenerInfo.FromData(localID, itemID, hostID, item); - if (!m_listeners.ContainsKey((int)item[2])) - m_listeners.Add((int)item[2], new List()); - m_listeners[(int)item[2]].Add(info); + lock (m_listeners) + { + if (!m_listeners.ContainsKey((int)item[2])) + m_listeners.Add((int)item[2], new List()); + m_listeners[(int)item[2]].Add(info); + } idx+=6; } -- cgit v1.1