aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-17 15:55:56 +0000
committerJustin Clarke Casey2009-02-17 15:55:56 +0000
commit6bcf7cbb2c117134435ccd70cf35c93964533c5e (patch)
tree8bab59bbe151bf917672bcb26617484adb453f60 /OpenSim/Region/CoreModules
parent* Apply http://opensimulator.org/mantis/view.php?id=3167 (diff)
downloadopensim-SC_OLD-6bcf7cbb2c117134435ccd70cf35c93964533c5e.zip
opensim-SC_OLD-6bcf7cbb2c117134435ccd70cf35c93964533c5e.tar.gz
opensim-SC_OLD-6bcf7cbb2c117134435ccd70cf35c93964533c5e.tar.bz2
opensim-SC_OLD-6bcf7cbb2c117134435ccd70cf35c93964533c5e.tar.xz
* 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
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs30
1 files changed, 15 insertions, 15 deletions
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
381 381
382 if (m_curlisteners < m_maxlisteners) 382 if (m_curlisteners < m_maxlisteners)
383 { 383 {
384 int newHandle = GetNewHandle(itemID); 384 lock (m_listeners)
385
386 if (newHandle > 0)
387 { 385 {
388 ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg); 386 int newHandle = GetNewHandle(itemID);
389 387
390 lock (m_listeners) 388 if (newHandle > 0)
391 { 389 {
392 List<ListenerInfo> listeners; 390 ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg);
393 if (!m_listeners.TryGetValue(channel,out listeners))
394 {
395 listeners = new List<ListenerInfo>();
396 m_listeners.Add(channel, listeners);
397 }
398 listeners.Add(li);
399 m_curlisteners++;
400 }
401 391
402 return newHandle; 392 List<ListenerInfo> listeners;
393 if (!m_listeners.TryGetValue(channel,out listeners))
394 {
395 listeners = new List<ListenerInfo>();
396 m_listeners.Add(channel, listeners);
397 }
398 listeners.Add(li);
399 m_curlisteners++;
400
401 return newHandle;
402 }
403 } 403 }
404 } 404 }
405 return -1; 405 return -1;