aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs47
2 files changed, 14 insertions, 36 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index f615250..dbcc4ed 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -39,7 +39,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
39 public enum StateSource 39 public enum StateSource
40 { 40 {
41 NewRez = 0, 41 NewRez = 0,
42 PrimCrossing = 1 42 PrimCrossing = 1,
43 ScriptedRez= 2
43 } 44 }
44 45
45 public interface IScriptWorkItem 46 public interface IScriptWorkItem
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 6584bb3..e5dfb2b 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -77,7 +77,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
77#pragma warning restore 414 77#pragma warning restore 414
78 private int m_EventLimit; 78 private int m_EventLimit;
79 private bool m_KillTimedOutScripts; 79 private bool m_KillTimedOutScripts;
80// bool m_firstStart = true;
81 80
82 private static List<XEngine> m_ScriptEngines = 81 private static List<XEngine> m_ScriptEngines =
83 new List<XEngine>(); 82 new List<XEngine>();
@@ -390,46 +389,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
390 389
391 Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez, (StateSource)stateSource}; 390 Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez, (StateSource)stateSource};
392 391
393 lock (m_CompileQueue) 392 if (stateSource == (int)StateSource.ScriptedRez)
394 { 393 {
395 m_CompileQueue.Enqueue(parms); 394 DoOnRezScript(parms);
396
397 if (m_CurrentCompile == null)
398 {
399// if (m_firstStart)
400// {
401// m_firstStart = false;
402// m_CurrentCompile = m_ThreadPool.QueueWorkItem(
403// new WorkItemCallback(this.DoScriptWait),
404// new Object[0]);
405// return;
406// }
407
408 m_CurrentCompile = m_ThreadPool.QueueWorkItem(
409 new WorkItemCallback(this.DoOnRezScriptQueue),
410 new Object[0]);
411 }
412 } 395 }
413 } 396 else
414
415 public Object DoScriptWait(Object dummy)
416 {
417 Thread.Sleep(10000);
418
419 lock (m_CompileQueue)
420 { 397 {
421 if (m_CompileQueue.Count > 0) 398 lock (m_CompileQueue)
422 { 399 {
423 m_CurrentCompile = m_ThreadPool.QueueWorkItem( 400 m_CompileQueue.Enqueue(parms);
424 new WorkItemCallback(this.DoOnRezScriptQueue), 401
425 new Object[0]); 402 if (m_CurrentCompile == null)
426 } 403 {
427 else 404 m_CurrentCompile = m_ThreadPool.QueueWorkItem(
428 { 405 new WorkItemCallback(this.DoOnRezScriptQueue),
429 m_CurrentCompile = null; 406 new Object[0]);
407 }
430 } 408 }
431 } 409 }
432 return null;
433 } 410 }
434 411
435 public Object DoOnRezScriptQueue(Object dummy) 412 public Object DoOnRezScriptQueue(Object dummy)