From 9f7366210ad52e00f8e903c23af21fffd84b03b9 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Fri, 22 Feb 2008 13:15:01 +0000 Subject: Now last commit will compile too... The features just keep on coming! --- .../ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | 10 ++++++++-- .../ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | 4 ++-- .../ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index 1a5cca1..14f7c4f 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs @@ -58,7 +58,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public void ReadConfig() { - MaintenanceLoopms = m_ScriptEngine.ScriptConfigSource.GetInt("MaintenanceLoopms", 50); + // Bad hack, but we need a m_ScriptEngine :) + foreach (ScriptEngine m_ScriptEngine in ScriptEngine.ScriptEngines) + { + MaintenanceLoopms = m_ScriptEngine.ScriptConfigSource.GetInt("MaintenanceLoopms", 50); + return; + } } #region " Maintenance thread " @@ -169,7 +174,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } catch (Exception ex) { - ScriptEngine.Log.Error("[" + lastScriptEngine.ScriptEngineName + "]: Exception in MaintenanceLoopThread. Thread will recover after 5 sec throttle. Exception: " + ex.ToString()); + if (lastScriptEngine != null) + lastScriptEngine.Log.Error("[" + lastScriptEngine.ScriptEngineName + "]: Exception in MaintenanceLoopThread. Thread will recover after 5 sec throttle. Exception: " + ex.ToString()); Thread.Sleep(5000); } } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index 67eefd9..0d087ed 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase [Serializable] public abstract class ScriptEngine : IRegionModule, OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule { - private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public static List ScriptEngines = new List(); public Scene World; @@ -76,7 +76,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public abstract ScriptManager _GetScriptManager(); - public static log4net.ILog Log + public log4net.ILog Log { get { return m_log; } } diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index b50c184..20ff07a 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs @@ -194,8 +194,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase { if (LUQueue.Count == 0) Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); - if (PleaseShutdown) - return; + //if (PleaseShutdown) + // return; if (LUQueue.Count > 0) { LUStruct item = LUQueue.Dequeue(); -- cgit v1.1