From 81a90e30c637f84e6ef5d1cf7c188c1f6db12eb3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 1 May 2013 19:29:46 +0100 Subject: [PATCH] Add in-code exaplanation for the change in cancellation signalling in STP 2.2.3. Remove left in Console.WriteLine accidentally inserted in recent 206fb306 --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 2 -- ThirdParty/SmartThreadPool/WorkItem.cs | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f9d3afc126..887a31765a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -628,8 +628,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } } - Console.WriteLine("Here9"); - lock (EventQueue) { workItem = m_CurrentWorkItem; diff --git a/ThirdParty/SmartThreadPool/WorkItem.cs b/ThirdParty/SmartThreadPool/WorkItem.cs index f229d1f4a4..185f10ce58 100644 --- a/ThirdParty/SmartThreadPool/WorkItem.cs +++ b/ThirdParty/SmartThreadPool/WorkItem.cs @@ -753,6 +753,16 @@ namespace Amib.Threading.Internal } else { + // ************************** + // Stock SmartThreadPool 2.2.3 sets these to true and relies on the thread to check the + // WorkItem cancellation status. However, OpenSimulator uses a different mechanism to notify + // scripts of co-operative termination and the abort code also relies on this method + // returning false in order to implement a small wait. + // + // Therefore, as was the case previously with STP, we will not signal successful cancellation + // here. It's possible that OpenSimulator code could be changed in the future to remove + // the need for this change. + // ************************** success = false; signalComplete = false; }