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

Subversion Repositories:
Rev:
Show entire fileRegard 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 174... Line 174...
174   174  
175 StartThread(); -  
176 } -  
Line 177... Line 175...
177 } 175 if (cmdEventTimer.Enabled.Equals(true)) return;
-   176  
178   177 // Start the timer
179 private static void StartThread() 178 cmdEventTimer.Elapsed += (sender, args) =>
180 { 179 {
181 if (cmdHandlerThread == null) 180 try
182 { 181 {
183 // Start the thread that will be doing the work 182 DoOneCmdHandlerPass();
-   183 }
184 cmdHandlerThread 184 catch (Exception e)
-   185 {
-   186 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
-   187 }
-   188 };
-   189  
-   190 cmdEventTimer.Interval = cmdHandlerThreadCycleSleepms;
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 }