clockwerk-opensim-stable – Diff between revs 1 and 2

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 1 Rev 2
Line 47... Line 47...
47 /// </summary> 47 /// </summary>
48 public class AsyncCommandManager 48 public class AsyncCommandManager
49 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
Line 51... Line -...
51   -  
52 private static Thread cmdHandlerThread; 51  
-   52 private static int cmdHandlerThreadCycleSleepms;
Line 53... Line 53...
53 private static int cmdHandlerThreadCycleSleepms; 53 private static readonly System.Timers.Timer cmdEventTimer = new System.Timers.Timer();
54   54  
55 /// <summary> 55 /// <summary>
56 /// Lock for reading/writing static components of AsyncCommandManager. 56 /// Lock for reading/writing static components of AsyncCommandManager.
Line 170... Line 170...
170 if (!m_SensorRepeat.ContainsKey(m_ScriptEngine)) 170 if (!m_SensorRepeat.ContainsKey(m_ScriptEngine))
171 m_SensorRepeat[m_ScriptEngine] = new SensorRepeat(this); 171 m_SensorRepeat[m_ScriptEngine] = new SensorRepeat(this);
172 if (!m_XmlRequest.ContainsKey(m_ScriptEngine)) 172 if (!m_XmlRequest.ContainsKey(m_ScriptEngine))
173 m_XmlRequest[m_ScriptEngine] = new XmlRequest(this); 173 m_XmlRequest[m_ScriptEngine] = new XmlRequest(this);
Line -... Line 174...
-   174  
-   175 if (cmdEventTimer.Enabled.Equals(true)) return;
174   176  
-   177 // Start the timer
175 StartThread(); 178 cmdEventTimer.Elapsed += (sender, args) =>
-   179 {
-   180 try
-   181 {
-   182 DoOneCmdHandlerPass();
-   183 }
-   184 catch (Exception e)
-   185 {
-   186 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
176 } 187 }
-   188 };
-   189  
-   190 cmdEventTimer.Interval = cmdHandlerThreadCycleSleepms;
Line 177... Line -...
177 } -  
178   -  
179 private static void StartThread() -  
180 { -  
181 if (cmdHandlerThread == null) -  
182 { -  
183 // Start the thread that will be doing the work -  
184 cmdHandlerThread -  
185 = Watchdog.StartThread( 191 cmdEventTimer.Enabled = true;
186 CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); 192  
Line 187... Line 193...
187 } 193 }
188 } 194 }
189   195  
190 private void ReadConfig() 196 private void ReadConfig()
191 { 197 {
192 // cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100); 198 // cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100);
Line 193... Line 199...
193 // TODO: Make this sane again 199 // TODO: Make this sane again
194 cmdHandlerThreadCycleSleepms = 100; 200 cmdHandlerThreadCycleSleepms = 50;
195 } 201 }
Line 437... Line 443...
437 } 443 }
438 } 444 }
439 } 445 }
440 } 446 }
441 } 447 }
442 } -  
443   448 }
-   449