From e14c8f59f7205ac010ed13387950647e5023b335 Mon Sep 17 00:00:00 2001
From: Tedd Hansen
Date: Fri, 1 Feb 2008 20:45:15 +0000
Subject: Added config options: ScriptThreadPriority to set script thread
priority DeactivateScriptOnTimeout to remove script if it is executing too
long
---
.../Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs')
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
index 6b2db35..d5826b7 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
@@ -82,11 +82,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
///
private int numberOfThreads;
+
///
/// Maximum time one function can use for execution before we perform a thread kill
///
private int maxFunctionExecutionTimems;
private bool EnforceMaxExecutionTime;
+ private bool KillScriptOnMaxFunctionExecutionTime;
///
@@ -169,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
maxFunctionExecutionTimems = m_ScriptEngine.ScriptConfigSource.GetInt("MaxEventExecutionTimeMs", 5000);
EnforceMaxExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("EnforceMaxEventExecutionTime", false);
-
+ KillScriptOnMaxFunctionExecutionTime = m_ScriptEngine.ScriptConfigSource.GetBoolean("DeactivateScriptOnTimeout", false);
// Start function max exec time enforcement thread
@@ -336,6 +338,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
maxFunctionExecutionTimems)
{
// We need to kill this thread!
+ EventQueueThread.KillCurrentScript = KillScriptOnMaxFunctionExecutionTime;
AbortThreadClass(EventQueueThread);
// Then start another
StartNewThreadClass();
--
cgit v1.1