Bugfixes - wasn't counting threads right++

afrisby-rexmerge
Tedd Hansen 2008-02-22 16:15:08 +00:00
parent 879a260498
commit 42bcd76b36
3 changed files with 17 additions and 17 deletions

View File

@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
/// List of threads (classes) processing event queue /// List of threads (classes) processing event queue
/// Note that this may or may not be a reference to a static object depending on PrivateRegionThreads config setting. /// Note that this may or may not be a reference to a static object depending on PrivateRegionThreads config setting.
/// </summary> /// </summary>
internal static List<EventQueueThreadClass> eventQueueThreads; // Thread pool that we work on internal static List<EventQueueThreadClass> eventQueueThreads = new List<EventQueueThreadClass>(); // Thread pool that we work on
/// <summary> /// <summary>
/// Locking access to eventQueueThreads AND staticGlobalEventQueueThreads. /// Locking access to eventQueueThreads AND staticGlobalEventQueueThreads.
/// </summary> /// </summary>
@ -172,7 +172,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{ {
m_ScriptEngine = _ScriptEngine; m_ScriptEngine = _ScriptEngine;
eventQueueThreads = new List<EventQueueThreadClass>();
ReadConfig(); ReadConfig();
} }

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -72,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void ReadConfig() public void ReadConfig()
{ {
foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines))
{ {
ScriptEngineName = m_ScriptEngine.ScriptEngineName; ScriptEngineName = m_ScriptEngine.ScriptEngineName;
nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50); nothingToDoSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("SleepTimeIfNoScriptExecutionMs", 50);
@ -186,7 +187,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void DoProcessQueue() public void DoProcessQueue()
{ {
foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines))
{ {
lastScriptEngine = m_ScriptEngine; lastScriptEngine = m_ScriptEngine;
// Every now and then check if we should shut down // Every now and then check if we should shut down

View File

@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
#if DEBUG #if DEBUG
//m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called"); //m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called");
#endif #endif
PleaseShutdown = true; //PleaseShutdown = true;
Thread.Sleep(100); Thread.Sleep(100);
try try
{ {
@ -130,8 +130,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
while (true) while (true)
{ {
System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass
if (PleaseShutdown) //if (PleaseShutdown)
return; // return;
foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines))
{ {
@ -187,14 +187,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
} }
#endregion #endregion
/// <summary> ///// <summary>
/// If set to true then threads and stuff should try to make a graceful exit ///// If set to true then threads and stuff should try to make a graceful exit
/// </summary> ///// </summary>
public bool PleaseShutdown //public bool PleaseShutdown
{ //{
get { return _PleaseShutdown; } // get { return _PleaseShutdown; }
set { _PleaseShutdown = value; } // set { _PleaseShutdown = value; }
} //}
private bool _PleaseShutdown = false; //private bool _PleaseShutdown = false;
} }
} }