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)
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
}
}