diff options
author | Tedd Hansen | 2008-02-22 16:15:08 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-22 16:15:08 +0000 |
commit | 42bcd76b36621e590e3756526e9550aea7932b14 (patch) | |
tree | 63fa2fd08a5c1bf7ac995e6703a678d6743599c1 | |
parent | Minor annoying Exception-bug fixed (diff) | |
download | opensim-SC-42bcd76b36621e590e3756526e9550aea7932b14.zip opensim-SC-42bcd76b36621e590e3756526e9550aea7932b14.tar.gz opensim-SC-42bcd76b36621e590e3756526e9550aea7932b14.tar.bz2 opensim-SC-42bcd76b36621e590e3756526e9550aea7932b14.tar.xz |
Bugfixes - wasn't counting threads right++
3 files changed, 17 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 581c7a0..85b55f7 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
68 | /// List of threads (classes) processing event queue | 68 | /// List of threads (classes) processing event queue |
69 | /// Note that this may or may not be a reference to a static object depending on PrivateRegionThreads config setting. | 69 | /// Note that this may or may not be a reference to a static object depending on PrivateRegionThreads config setting. |
70 | /// </summary> | 70 | /// </summary> |
71 | internal static List<EventQueueThreadClass> eventQueueThreads; // Thread pool that we work on | 71 | internal static List<EventQueueThreadClass> eventQueueThreads = new List<EventQueueThreadClass>(); // Thread pool that we work on |
72 | /// <summary> | 72 | /// <summary> |
73 | /// Locking access to eventQueueThreads AND staticGlobalEventQueueThreads. | 73 | /// Locking access to eventQueueThreads AND staticGlobalEventQueueThreads. |
74 | /// </summary> | 74 | /// </summary> |
@@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
131 | /// Queue containing events waiting to be executed | 131 | /// Queue containing events waiting to be executed |
132 | /// </summary> | 132 | /// </summary> |
133 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); | 133 | public Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); |
134 | 134 | ||
135 | #region " Queue structures " | 135 | #region " Queue structures " |
136 | /// <summary> | 136 | /// <summary> |
137 | /// Queue item structure | 137 | /// Queue item structure |
@@ -172,7 +172,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
172 | { | 172 | { |
173 | m_ScriptEngine = _ScriptEngine; | 173 | m_ScriptEngine = _ScriptEngine; |
174 | 174 | ||
175 | eventQueueThreads = new List<EventQueueThreadClass>(); | ||
176 | ReadConfig(); | 175 | ReadConfig(); |
177 | } | 176 | } |
178 | 177 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index f36baa7..c0edcc4 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections; | ||
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Text; | 32 | using System.Text; |
32 | using System.Threading; | 33 | using System.Threading; |
@@ -72,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
72 | 73 | ||
73 | public void ReadConfig() | 74 | public void ReadConfig() |
74 | { | 75 | { |
75 | foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) | 76 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) |
76 | { | 77 | { |
77 | ScriptEngineName = m_ScriptEngine.ScriptEngineName; | 78 | ScriptEngineName = m_ScriptEngine.ScriptEngineName; |
78 | nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50); | 79 | nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50); |
@@ -186,7 +187,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
186 | 187 | ||
187 | public void DoProcessQueue() | 188 | public void DoProcessQueue() |
188 | { | 189 | { |
189 | foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) | 190 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) |
190 | { | 191 | { |
191 | lastScriptEngine = m_ScriptEngine; | 192 | lastScriptEngine = m_ScriptEngine; |
192 | // Every now and then check if we should shut down | 193 | // Every now and then check if we should shut down |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index af88183..0458a50 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
96 | #if DEBUG | 96 | #if DEBUG |
97 | //m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called"); | 97 | //m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called"); |
98 | #endif | 98 | #endif |
99 | PleaseShutdown = true; | 99 | //PleaseShutdown = true; |
100 | Thread.Sleep(100); | 100 | Thread.Sleep(100); |
101 | try | 101 | try |
102 | { | 102 | { |
@@ -130,8 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
130 | while (true) | 130 | while (true) |
131 | { | 131 | { |
132 | System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass | 132 | System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass |
133 | if (PleaseShutdown) | 133 | //if (PleaseShutdown) |
134 | return; | 134 | // return; |
135 | 135 | ||
136 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) | 136 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) |
137 | { | 137 | { |
@@ -187,14 +187,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
187 | } | 187 | } |
188 | #endregion | 188 | #endregion |
189 | 189 | ||
190 | /// <summary> | 190 | ///// <summary> |
191 | /// If set to true then threads and stuff should try to make a graceful exit | 191 | ///// If set to true then threads and stuff should try to make a graceful exit |
192 | /// </summary> | 192 | ///// </summary> |
193 | public bool PleaseShutdown | 193 | //public bool PleaseShutdown |
194 | { | 194 | //{ |
195 | get { return _PleaseShutdown; } | 195 | // get { return _PleaseShutdown; } |
196 | set { _PleaseShutdown = value; } | 196 | // set { _PleaseShutdown = value; } |
197 | } | 197 | //} |
198 | private bool _PleaseShutdown = false; | 198 | //private bool _PleaseShutdown = false; |
199 | } | 199 | } |
200 | } | 200 | } |