aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-05-23 07:35:02 +0100
committerUbitUmarov2017-05-23 07:35:02 +0100
commitc0bfaac0ac6873720b7c3721436ca54e93d5072c (patch)
tree62f6b02569ba6dd968d76ad9bf2aa6ccf839d588 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
parentreenqueue poll events while conn is open, and not expired (diff)
parent dont log timeouts on stopped threads (diff)
downloadopensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.zip
opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.gz
opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.bz2
opensim-SC-c0bfaac0ac6873720b7c3721436ca54e93d5072c.tar.xz
merge master
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs68
1 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index 6a39bb9..eb6455a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
51 51
52 private static Thread cmdHandlerThread; 52 private static Thread cmdHandlerThread;
53 private static int cmdHandlerThreadCycleSleepms; 53 private static int cmdHandlerThreadCycleSleepms;
54 54 private static int numInstances;
55 /// <summary> 55 /// <summary>
56 /// Lock for reading/writing static components of AsyncCommandManager. 56 /// Lock for reading/writing static components of AsyncCommandManager.
57 /// </summary> 57 /// </summary>
@@ -172,18 +172,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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);
174 174
175 StartThread(); 175 numInstances++;
176 } 176 if (cmdHandlerThread == null)
177 } 177 {
178 178 cmdHandlerThread = WorkManager.StartThread(
179 private static void StartThread()
180 {
181 if (cmdHandlerThread == null)
182 {
183 // Start the thread that will be doing the work
184 cmdHandlerThread
185 = WorkManager.StartThread(
186 CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); 179 CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true);
180 }
187 } 181 }
188 } 182 }
189 183
@@ -197,20 +191,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
197 ~AsyncCommandManager() 191 ~AsyncCommandManager()
198 { 192 {
199 // Shut down thread 193 // Shut down thread
200// try 194 try
201// { 195 {
202// if (cmdHandlerThread != null) 196 lock (staticLock)
203// { 197 {
204// if (cmdHandlerThread.IsAlive == true) 198 numInstances--;
205// { 199 if(numInstances > 0)
206// cmdHandlerThread.Abort(); 200 return;
207// //cmdHandlerThread.Join(); 201 if (cmdHandlerThread != null)
208// } 202 {
209// } 203 if (cmdHandlerThread.IsAlive == true)
210// } 204 {
211// catch 205 cmdHandlerThread.Abort();
212// { 206 //cmdHandlerThread.Join();
213// } 207 cmdHandlerThread = null;
208 }
209 }
210 }
211 }
212 catch
213 {
214 }
214 } 215 }
215 216
216 /// <summary> 217 /// <summary>
@@ -240,24 +241,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
240 lock (staticLock) 241 lock (staticLock)
241 { 242 {
242 // Check HttpRequests 243 // Check HttpRequests
243 m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests(); 244 try { m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests(); } catch {}
244 245
245 // Check XMLRPCRequests 246 // Check XMLRPCRequests
246 m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); 247 try { m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); } catch {}
247 248
248 foreach (IScriptEngine s in m_ScriptEngines) 249 foreach (IScriptEngine s in m_ScriptEngines)
249 { 250 {
250 // Check Listeners 251 // Check Listeners
251 m_Listener[s].CheckListeners(); 252 try { m_Listener[s].CheckListeners(); } catch {}
253
252 254
253 // Check timers 255 // Check timers
254 m_Timer[s].CheckTimerEvents(); 256 try { m_Timer[s].CheckTimerEvents(); } catch {}
255 257
256 // Check Sensors 258 // Check Sensors
257 m_SensorRepeat[s].CheckSenseRepeaterEvents(); 259 try { m_SensorRepeat[s].CheckSenseRepeaterEvents(); } catch {}
258 260
259 // Check dataserver 261 // Check dataserver
260 m_Dataserver[s].ExpireRequests(); 262 try { m_Dataserver[s].ExpireRequests(); } catch {}
261 } 263 }
262 } 264 }
263 } 265 }
@@ -387,8 +389,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
387 } 389 }
388 } 390 }
389 391
390
391
392 public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) 392 public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID)
393 { 393 {
394 List<Object> data = new List<Object>(); 394 List<Object> data = new List<Object>();