opensim

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 1  →  ?path2? @ HEAD
/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -105,7 +105,7 @@
protected AsyncCommandManager AsyncCommands = null;
protected float m_ScriptDelayFactor = 1.0f;
protected float m_ScriptDistanceFactor = 1.0f;
protected float m_MinTimerInterval = 0.01f;
protected float m_MinTimerInterval = 0.05f;
protected float m_recoilScaleFactor = 0.0f;
 
protected DateTime m_timer = DateTime.Now;
@@ -165,7 +165,7 @@
m_ScriptDistanceFactor =
m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
m_MinTimerInterval =
m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.01f);
m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.05f);
m_automaticLinkPermission =
m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
m_notecardLineReadCharsMax =
/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -49,9 +49,8 @@
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
private static Thread cmdHandlerThread;
private static int cmdHandlerThreadCycleSleepms;
private static readonly AutoResetEvent cmdHandlerResetEvent = new AutoResetEvent(false);
private static readonly System.Timers.Timer cmdEventTimer = new System.Timers.Timer();
 
/// <summary>
/// Lock for reading/writing static components of AsyncCommandManager.
@@ -173,26 +172,29 @@
if (!m_XmlRequest.ContainsKey(m_ScriptEngine))
m_XmlRequest[m_ScriptEngine] = new XmlRequest(this);
 
StartThread();
}
}
 
private static void StartThread()
if (cmdEventTimer.Enabled.Equals(true)) return;
// Start the timer
cmdEventTimer.Elapsed += (sender, args) =>
{
if (cmdHandlerThread == null)
try
{
// Start the thread that will be doing the work
cmdHandlerThread
= Watchdog.StartThread(
CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true);
DoOneCmdHandlerPass();
}
catch (Exception e)
{
m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
}
};
cmdEventTimer.Interval = cmdHandlerThreadCycleSleepms;
cmdEventTimer.Enabled = true;
}
}
 
private void ReadConfig()
{
// cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100);
// TODO: Make this sane again
cmdHandlerThreadCycleSleepms = 100;
cmdHandlerThreadCycleSleepms = 50;
}
 
~AsyncCommandManager()
@@ -223,10 +225,10 @@
{
try
{
//Thread.Sleep(cmdHandlerThreadCycleSleepms);
Thread.Sleep(cmdHandlerThreadCycleSleepms);
 
DoOneCmdHandlerPass();
cmdHandlerResetEvent.WaitOne(-1, false);
 
Watchdog.UpdateThread();
}
catch (Exception e)
@@ -261,7 +263,6 @@
m_Dataserver[s].ExpireRequests();
}
}
cmdHandlerResetEvent.Set();
}
 
/// <summary>