Added OpenSim.32BitLaunch.exe that can be used on 64-bit systems to run OpenSim in 32-bit mode.
Fixed ScriptEngine.Common startup problems.ThreadPoolClientBranch
parent
a9b69f3880
commit
667197f24d
|
@ -28,6 +28,7 @@
|
|||
|
||||
using System.IO;
|
||||
using libsecondlife;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Grid.ScriptServer.ScriptServer;
|
||||
|
@ -66,8 +67,8 @@ namespace OpenSim.Grid.ScriptServer
|
|||
|
||||
// Load DotNetEngine
|
||||
Engine = ScriptEngines.LoadEngine("DotNetEngine");
|
||||
|
||||
Engine.InitializeEngine(null, m_log, false, Engine.GetScriptManager());
|
||||
IConfigSource config = null;
|
||||
Engine.InitializeEngine(null, null, m_log, false, Engine.GetScriptManager());
|
||||
|
||||
|
||||
// Set up server
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
/// Locking access to eventQueueThreads AND staticGlobalEventQueueThreads.
|
||||
/// Note that this may or may not be a reference to a static object depending on PrivateRegionThreads config setting.
|
||||
/// </summary>
|
||||
private object eventQueueThreadsLock;
|
||||
private object eventQueueThreadsLock = new object();
|
||||
// Static objects for referencing the objects above if we don't have private threads:
|
||||
internal static List<EventQueueThreadClass> staticEventQueueThreads; // A static reference used if we don't use private threads
|
||||
internal static object staticEventQueueThreadsLock; // Statick lock object reference for same reason
|
||||
|
@ -173,10 +173,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
{
|
||||
m_ScriptEngine = _ScriptEngine;
|
||||
|
||||
bool PrivateRegionThreads = m_ScriptEngine.ScriptConfigSource.GetBoolean("PrivateRegionThreads", false);
|
||||
|
||||
// Create thread pool list and lock object
|
||||
// Determine from config if threads should be dedicated to regions or shared
|
||||
if (m_ScriptEngine.ScriptConfigSource.GetBoolean("PrivateRegionThreads", false))
|
||||
if (PrivateRegionThreads)
|
||||
{
|
||||
// PRIVATE THREAD POOL PER REGION
|
||||
eventQueueThreads = new List<EventQueueThreadClass>();
|
||||
|
@ -185,13 +186,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
else
|
||||
{
|
||||
// SHARED THREAD POOL
|
||||
// Crate the objects in statics
|
||||
// Crate the static objects
|
||||
if (staticEventQueueThreads == null)
|
||||
staticEventQueueThreads = new List<EventQueueThreadClass>();
|
||||
if (staticEventQueueThreadsLock == null)
|
||||
staticEventQueueThreadsLock = new object();
|
||||
|
||||
// Create local reference to them
|
||||
// Now reference our locals to them
|
||||
eventQueueThreads = staticEventQueueThreads;
|
||||
eventQueueThreadsLock = staticEventQueueThreadsLock;
|
||||
}
|
||||
|
@ -228,7 +229,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
|
||||
private void Stop()
|
||||
{
|
||||
|
||||
if (eventQueueThreadsLock != null && eventQueueThreads != null)
|
||||
{
|
||||
// Kill worker threads
|
||||
lock (eventQueueThreadsLock)
|
||||
{
|
||||
|
@ -239,6 +241,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
eventQueueThreads.Clear();
|
||||
staticGlobalEventQueueThreads.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all entries from our event queue
|
||||
lock (queueLock)
|
||||
{
|
||||
|
|
|
@ -86,13 +86,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
get { return m_log; }
|
||||
}
|
||||
|
||||
public void InitializeEngine(Scene Sceneworld, LogBase logger, bool HookUpToServer, ScriptManager newScriptManager)
|
||||
public void InitializeEngine(Scene Sceneworld, IConfigSource config, LogBase logger, bool HookUpToServer, ScriptManager newScriptManager)
|
||||
{
|
||||
World = Sceneworld;
|
||||
m_log = logger;
|
||||
ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
|
||||
ConfigSource = config;
|
||||
Log.Verbose(ScriptEngineName, "ScriptEngine initializing");
|
||||
Log.Verbose(ScriptEngineName, "Reading configuration from config section \"" + ScriptEngineName + "\"");
|
||||
|
||||
Log.Verbose(ScriptEngineName, "DotNet & LSL ScriptEngine initializing");
|
||||
// Make sure we have config
|
||||
if (ConfigSource.Configs[ScriptEngineName] == null)
|
||||
ConfigSource.AddConfig(ScriptEngineName);
|
||||
ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
|
||||
|
||||
//m_logger.Status(ScriptEngineName, "InitializeEngine");
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
|
||||
using libsecondlife;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
|
@ -81,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
|||
public interface ScriptEngine
|
||||
{
|
||||
RemoteEvents EventManager();
|
||||
void InitializeEngine(Scene Sceneworld, LogBase logger, bool DontHookUp, ScriptManager newScriptManager);
|
||||
void InitializeEngine(Scene Sceneworld, IConfigSource config, LogBase logger, bool DontHookUp, ScriptManager newScriptManager);
|
||||
ScriptManager GetScriptManager();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
public override void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
ConfigSource = config;
|
||||
InitializeEngine(scene, MainLog.Instance, true, GetScriptManager());
|
||||
InitializeEngine(scene, config, MainLog.Instance, true, GetScriptManager());
|
||||
}
|
||||
|
||||
public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager()
|
||||
|
|
|
@ -41,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
: base(scriptEngine)
|
||||
{
|
||||
base.m_scriptEngine = scriptEngine;
|
||||
|
||||
}
|
||||
|
||||
// KEEP TRACK OF SCRIPTS <int id, whatever script>
|
||||
|
@ -55,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
public override void _StartScript(uint localID, LLUUID itemID, string Script)
|
||||
{
|
||||
//IScriptHost root = host.GetRoot();
|
||||
Console.WriteLine("ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID);
|
||||
m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID);
|
||||
|
||||
// We will initialize and start the script.
|
||||
// It will be up to the script itself to hook up the correct events.
|
||||
|
@ -77,7 +76,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(ScriptSource);
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before);
|
||||
m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before);
|
||||
#endif
|
||||
|
||||
CompiledScript.Source = Script;
|
||||
|
@ -110,8 +109,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
}
|
||||
catch (Exception e2)
|
||||
{
|
||||
m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString());
|
||||
m_scriptEngine.Log.Error("ScriptEngine",
|
||||
m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Error displaying error in-world: " + e2.ToString());
|
||||
m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName,
|
||||
"Errormessage: Error compiling script:\r\n" + e.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
@ -120,8 +119,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
public override void _StopScript(uint localID, LLUUID itemID)
|
||||
{
|
||||
// Stop script
|
||||
Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString());
|
||||
|
||||
#if DEBUG
|
||||
m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Stop script localID: " + localID + " LLUID: " + itemID.ToString());
|
||||
#endif
|
||||
|
||||
// Stop long command on script
|
||||
m_scriptEngine.m_ASYNCLSLCommandManager.RemoveScript(localID, itemID);
|
||||
|
@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() +
|
||||
m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() +
|
||||
": " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
|
|||
// We need to override a few things for our DotNetEngine
|
||||
public override void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
InitializeEngine(scene, MainLog.Instance, true, GetScriptManager());
|
||||
InitializeEngine(scene, config, MainLog.Instance, true, GetScriptManager());
|
||||
}
|
||||
|
||||
public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager()
|
||||
|
|
|
@ -1280,6 +1280,7 @@
|
|||
<Reference name="libsecondlife.dll"/>
|
||||
<Reference name="Axiom.MathLib.dll" localCopy="false"/>
|
||||
<Reference name="XMLRPC.dll"/>
|
||||
<Reference name="Nini.dll" />
|
||||
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="true"/>
|
||||
|
|
Loading…
Reference in New Issue