aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-02-22 12:50:24 +0000
committerTedd Hansen2008-02-22 12:50:24 +0000
commita040008cb956f4e99bc87a006b51925966443d63 (patch)
treeaa3a5b1cc2249993c5ae73b1a27787dda103e306 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
parent* Relative large ClientView refactoring of packet Events into .Net recommende... (diff)
downloadopensim-SC_OLD-a040008cb956f4e99bc87a006b51925966443d63.zip
opensim-SC_OLD-a040008cb956f4e99bc87a006b51925966443d63.tar.gz
opensim-SC_OLD-a040008cb956f4e99bc87a006b51925966443d63.tar.bz2
opensim-SC_OLD-a040008cb956f4e99bc87a006b51925966443d63.tar.xz
From this commit and a few hours into the future ScriptEngine will be unstable:
* Speeding up ScriptEngine shutdown * Sharing threads so that minimum total thread count for any amount of regions will be 2. (1 maintenance, 1 script execution) You can choose more script exec threads if you want of course. In this commit: Sharing maintenance thread between all regions.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs49
1 files changed, 23 insertions, 26 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index 684d133..b50c184 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -169,15 +169,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
169 // Abort load/unload thread 169 // Abort load/unload thread
170 try 170 try
171 { 171 {
172 PleaseShutdown = true; 172 //PleaseShutdown = true;
173 Thread.Sleep(100); 173 //Thread.Sleep(100);
174 if (scriptLoadUnloadThread != null) 174 if (scriptLoadUnloadThread != null && scriptLoadUnloadThread.IsAlive == true)
175 { 175 {
176 if (scriptLoadUnloadThread.IsAlive == true) 176 scriptLoadUnloadThread.Abort();
177 { 177 //scriptLoadUnloadThread.Join();
178 scriptLoadUnloadThread.Abort();
179 scriptLoadUnloadThread.Join();
180 }
181 } 178 }
182 } 179 }
183 catch 180 catch
@@ -282,7 +279,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
282 279
283 public abstract void _StartScript(uint localID, LLUUID itemID, string Script); 280 public abstract void _StartScript(uint localID, LLUUID itemID, string Script);
284 public abstract void _StopScript(uint localID, LLUUID itemID); 281 public abstract void _StopScript(uint localID, LLUUID itemID);
285 282
286 283
287 #endregion 284 #endregion
288 285
@@ -297,10 +294,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
297 /// <param name="args">Arguments to pass to function</param> 294 /// <param name="args">Arguments to pass to function</param>
298 internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args) 295 internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args)
299 { 296 {
300//cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined 297 //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined
301///#if DEBUG 298 ///#if DEBUG
302/// Console.WriteLine("ScriptEngine: Inside ExecuteEvent for event " + FunctionName); 299 /// Console.WriteLine("ScriptEngine: Inside ExecuteEvent for event " + FunctionName);
303///#endif 300 ///#endif
304 // Execute a function in the script 301 // Execute a function in the script
305 //m_scriptEngine.Log.Info("[" + ScriptEngineName + "]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); 302 //m_scriptEngine.Log.Info("[" + ScriptEngineName + "]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
306 //ScriptBaseInterface Script = (ScriptBaseInterface)GetScript(localID, itemID); 303 //ScriptBaseInterface Script = (ScriptBaseInterface)GetScript(localID, itemID);
@@ -309,10 +306,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
309 { 306 {
310 return; 307 return;
311 } 308 }
312//cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined 309 //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined
313///#if DEBUG 310 ///#if DEBUG
314/// Console.WriteLine("ScriptEngine: Executing event: " + FunctionName); 311 /// Console.WriteLine("ScriptEngine: Executing event: " + FunctionName);
315///#endif 312 ///#endif
316 // Must be done in correct AppDomain, so leaving it up to the script itself 313 // Must be done in correct AppDomain, so leaving it up to the script itself
317 Script.llDetectParams = qParams; 314 Script.llDetectParams = qParams;
318 Script.Exec.ExecuteEvent(FunctionName, args); 315 Script.Exec.ExecuteEvent(FunctionName, args);
@@ -418,15 +415,15 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
418 415
419 #endregion 416 #endregion
420 417
421 /// <summary> 418 ///// <summary>
422 /// If set to true then threads and stuff should try to make a graceful exit 419 ///// If set to true then threads and stuff should try to make a graceful exit
423 /// </summary> 420 ///// </summary>
424 public bool PleaseShutdown 421 //public bool PleaseShutdown
425 { 422 //{
426 get { return _PleaseShutdown; } 423 // get { return _PleaseShutdown; }
427 set { _PleaseShutdown = value; } 424 // set { _PleaseShutdown = value; }
428 } 425 //}
429 private bool _PleaseShutdown = false; 426 //private bool _PleaseShutdown = false;
430 427
431 } 428 }
432} 429}