From 53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 25 Aug 2007 21:50:28 +0000 Subject: Forgot mutex lock on List<> for timers --- .../ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs index 2395dbd..5ce972a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs @@ -124,20 +124,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (Timers.Count == 0) return; - // Go through all timers - foreach (TimerClass ts in Timers) + lock (ListLock) { - // Time has passed? - if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) + + // Go through all timers + foreach (TimerClass ts in Timers) { - // Add it to queue - myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); - // set next interval - - - ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); + // Time has passed? + if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) + { + // Add it to queue + myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); + // set next interval + + + ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); + } } - } + } // lock } } -- cgit v1.1