Forgot mutex lock on List<> for timers

afrisby
Tedd Hansen 2007-08-25 21:50:28 +00:00
parent d9b9b16513
commit 53ef427e9e
1 changed files with 15 additions and 11 deletions

View File

@ -124,20 +124,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
if (Timers.Count == 0) if (Timers.Count == 0)
return; return;
// Go through all timers lock (ListLock)
foreach (TimerClass ts in Timers)
{ {
// Time has passed?
if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) // Go through all timers
foreach (TimerClass ts in Timers)
{ {
// Add it to queue // Time has passed?
myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime())
// set next interval {
// Add it to queue
myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { });
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); // set next interval
ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
}
} }
} } // lock
} }
} }