diff options
author | Tedd Hansen | 2007-08-25 21:50:28 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-25 21:50:28 +0000 |
commit | 53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e (patch) | |
tree | d8153c9c32d77968cc9af7c516367e9ecb73a9fc /OpenSim/Region/ScriptEngine | |
parent | Script compiler should now show error on correct line number in original LSL-... (diff) | |
download | opensim-SC-53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e.zip opensim-SC-53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e.tar.gz opensim-SC-53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e.tar.bz2 opensim-SC-53ef427e9ebad3f130bb0b7ed2d76c91fb2ef68e.tar.xz |
Forgot mutex lock on List<> for timers
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/LSLLongCmdHandler.cs | 26 |
1 files changed, 15 insertions, 11 deletions
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 | |||
124 | if (Timers.Count == 0) | 124 | if (Timers.Count == 0) |
125 | return; | 125 | return; |
126 | 126 | ||
127 | // Go through all timers | 127 | lock (ListLock) |
128 | foreach (TimerClass ts in Timers) | ||
129 | { | 128 | { |
130 | // Time has passed? | 129 | |
131 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) | 130 | // Go through all timers |
131 | foreach (TimerClass ts in Timers) | ||
132 | { | 132 | { |
133 | // Add it to queue | 133 | // Time has passed? |
134 | myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); | 134 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) |
135 | // set next interval | 135 | { |
136 | 136 | // Add it to queue | |
137 | 137 | myScriptEngine.myEventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", new object[] { }); | |
138 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); | 138 | // set next interval |
139 | |||
140 | |||
141 | ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); | ||
142 | } | ||
139 | } | 143 | } |
140 | } | 144 | } // lock |
141 | } | 145 | } |
142 | 146 | ||
143 | } | 147 | } |