From 6bcf7cbb2c117134435ccd70cf35c93964533c5e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 17 Feb 2009 15:55:56 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=3179 * This slightly extends a lock in WorldCommModule so that it covers the GetNewHandle method which states in it's doc that it assumes locking has happened before the method is called * Thanks DoranZemlja --- .../Scripting/WorldComm/WorldCommModule.cs | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index b1f4b84..090f1d5 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -381,25 +381,25 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (m_curlisteners < m_maxlisteners) { - int newHandle = GetNewHandle(itemID); - - if (newHandle > 0) + lock (m_listeners) { - ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg); + int newHandle = GetNewHandle(itemID); - lock (m_listeners) + if (newHandle > 0) { - List listeners; - if (!m_listeners.TryGetValue(channel,out listeners)) - { - listeners = new List(); - m_listeners.Add(channel, listeners); - } - listeners.Add(li); - m_curlisteners++; - } + ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg); - return newHandle; + List listeners; + if (!m_listeners.TryGetValue(channel,out listeners)) + { + listeners = new List(); + m_listeners.Add(channel, listeners); + } + listeners.Add(li); + m_curlisteners++; + + return newHandle; + } } } return -1; -- cgit v1.1