diff options
author | Tedd Hansen | 2008-02-22 22:53:19 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-22 22:53:19 +0000 |
commit | 46cfc475aa53fd7e7eee270f4dea4bd25c75c050 (patch) | |
tree | e623dcdc149b8249441def51a44b5b15983a1d55 /OpenSim/Region/ScriptEngine/Common | |
parent | One more: Async LSL command thread is also shared now. (diff) | |
download | opensim-SC_OLD-46cfc475aa53fd7e7eee270f4dea4bd25c75c050.zip opensim-SC_OLD-46cfc475aa53fd7e7eee270f4dea4bd25c75c050.tar.gz opensim-SC_OLD-46cfc475aa53fd7e7eee270f4dea4bd25c75c050.tar.bz2 opensim-SC_OLD-46cfc475aa53fd7e7eee270f4dea4bd25c75c050.tar.xz |
ScriptEngine works again (startup-nully-error gone)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
4 files changed, 18 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs index 556593d..33c6511 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs | |||
@@ -42,13 +42,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
42 | public class AsyncLSLCommandManager : iScriptEngineFunctionModule | 42 | public class AsyncLSLCommandManager : iScriptEngineFunctionModule |
43 | { | 43 | { |
44 | private static Thread cmdHandlerThread; | 44 | private static Thread cmdHandlerThread; |
45 | private int cmdHandlerThreadCycleSleepms; | 45 | private static int cmdHandlerThreadCycleSleepms; |
46 | 46 | ||
47 | private ScriptEngine m_ScriptEngine; | 47 | private ScriptEngine m_ScriptEngine; |
48 | 48 | ||
49 | public AsyncLSLCommandManager() | 49 | public AsyncLSLCommandManager(ScriptEngine _ScriptEngine) |
50 | { | 50 | { |
51 | //m_ScriptEngine = _ScriptEngine; | 51 | m_ScriptEngine = _ScriptEngine; |
52 | ReadConfig(); | 52 | ReadConfig(); |
53 | 53 | ||
54 | StartThread(); | 54 | StartThread(); |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | private void CmdHandlerThreadLoop() | 95 | private static void CmdHandlerThreadLoop() |
96 | { | 96 | { |
97 | while (true) | 97 | while (true) |
98 | { | 98 | { |
@@ -101,14 +101,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
101 | while (true) | 101 | while (true) |
102 | { | 102 | { |
103 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 103 | Thread.Sleep(cmdHandlerThreadCycleSleepms); |
104 | lock (ScriptEngine.ScriptEngines) | 104 | //lock (ScriptEngine.ScriptEngines) |
105 | { | 105 | //{ |
106 | foreach (ScriptEngine se in ScriptEngine.ScriptEngines) | 106 | foreach (ScriptEngine se in new ArrayList(ScriptEngine.ScriptEngines)) |
107 | { | 107 | { |
108 | m_ScriptEngine = se; | 108 | se.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); |
109 | m_ScriptEngine.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); | ||
110 | } | 109 | } |
111 | } | 110 | //} |
112 | // Sleep before next cycle | 111 | // Sleep before next cycle |
113 | //Thread.Sleep(cmdHandlerThreadCycleSleepms); | 112 | //Thread.Sleep(cmdHandlerThreadCycleSleepms); |
114 | } | 113 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index a70e93b..caf043d 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -73,9 +73,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
73 | 73 | ||
74 | public void ReadConfig() | 74 | public void ReadConfig() |
75 | { | 75 | { |
76 | //lock (ScriptEngine.ScriptEngines) | 76 | lock (ScriptEngine.ScriptEngines) |
77 | //{ | 77 | { |
78 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) | 78 | foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) |
79 | { | 79 | { |
80 | ScriptEngineName = m_ScriptEngine.ScriptEngineName; | 80 | ScriptEngineName = m_ScriptEngine.ScriptEngineName; |
81 | nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50); | 81 | nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50); |
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
106 | break; | 106 | break; |
107 | } | 107 | } |
108 | } | 108 | } |
109 | //} | 109 | } |
110 | // Now set that priority | 110 | // Now set that priority |
111 | if (EventQueueThread != null) | 111 | if (EventQueueThread != null) |
112 | if (EventQueueThread.IsAlive) | 112 | if (EventQueueThread.IsAlive) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index eb57a9e..0fcabab 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | |||
@@ -164,9 +164,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
164 | MaintenanceLoopTicks_Other_Count++; | 164 | MaintenanceLoopTicks_Other_Count++; |
165 | 165 | ||
166 | 166 | ||
167 | lock (ScriptEngine.ScriptEngines) | 167 | //lock (ScriptEngine.ScriptEngines) |
168 | { | 168 | //{ |
169 | foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) | 169 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) |
170 | { | 170 | { |
171 | lastScriptEngine = m_ScriptEngine; | 171 | lastScriptEngine = m_ScriptEngine; |
172 | // Re-reading config every x seconds | 172 | // Re-reading config every x seconds |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
212 | m_ScriptEngine.m_ScriptManager.DoScriptLoadUnload(); | 212 | m_ScriptEngine.m_ScriptManager.DoScriptLoadUnload(); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | } | 215 | //} |
216 | } | 216 | } |
217 | } | 217 | } |
218 | catch (Exception ex) | 218 | catch (Exception ex) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index b861ad5..ac115e9 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
110 | newScriptManager.Start(); | 110 | newScriptManager.Start(); |
111 | m_ScriptManager = newScriptManager; | 111 | m_ScriptManager = newScriptManager; |
112 | m_AppDomainManager = new AppDomainManager(this); | 112 | m_AppDomainManager = new AppDomainManager(this); |
113 | m_ASYNCLSLCommandManager = new AsyncLSLCommandManager(); | 113 | m_ASYNCLSLCommandManager = new AsyncLSLCommandManager(this); |
114 | if (m_MaintenanceThread == null) | 114 | if (m_MaintenanceThread == null) |
115 | m_MaintenanceThread = new MaintenanceThread(); | 115 | m_MaintenanceThread = new MaintenanceThread(); |
116 | 116 | ||