aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-11-27 19:01:45 +0000
committerJustin Clark-Casey (justincc)2009-11-27 19:01:45 +0000
commit2e47e5147547d355d8935404c43fbe1b61888ee1 (patch)
treeda36d5353f4107d7e59c6456c67b12dca081ef3b
parentApply patch that fixes the failing T013_eStateSettingsRandomStorage test (diff)
downloadopensim-SC-2e47e5147547d355d8935404c43fbe1b61888ee1.zip
opensim-SC-2e47e5147547d355d8935404c43fbe1b61888ee1.tar.gz
opensim-SC-2e47e5147547d355d8935404c43fbe1b61888ee1.tar.bz2
opensim-SC-2e47e5147547d355d8935404c43fbe1b61888ee1.tar.xz
Make locking of timers and listeners in script related functions consistent
See http://opensimulator.org/mantis/view.php?id=4316 Thanks KittyLiu!
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs5
2 files changed, 10 insertions, 4 deletions
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
602 ListenerInfo info = 602 ListenerInfo info =
603 ListenerInfo.FromData(localID, itemID, hostID, item); 603 ListenerInfo.FromData(localID, itemID, hostID, item);
604 604
605 if (!m_listeners.ContainsKey((int)item[2])) 605 lock (m_listeners)
606 m_listeners.Add((int)item[2], new List<ListenerInfo>()); 606 {
607 m_listeners[(int)item[2]].Add(info); 607 if (!m_listeners.ContainsKey((int)item[2]))
608 m_listeners.Add((int)item[2], new List<ListenerInfo>());
609 m_listeners[(int)item[2]].Add(info);
610 }
608 611
609 idx+=6; 612 idx+=6;
610 } 613 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
index 0716d45..eeb59d9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
@@ -166,7 +166,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
166 ts.next = DateTime.Now.Ticks + (long)data[idx+1]; 166 ts.next = DateTime.Now.Ticks + (long)data[idx+1];
167 idx += 2; 167 idx += 2;
168 168
169 Timers.Add(MakeTimerKey(localID,itemID), ts); 169 lock (TimerListLock)
170 {
171 Timers.Add(MakeTimerKey(localID, itemID), ts);
172 }
170 } 173 }
171 } 174 }
172 } 175 }