From e6fd8365af0b0dc7a4664278c369752cb4e87155 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Dec 2012 21:37:02 +0000 Subject: Extend default 1 second wait for event completion to other thread script reset (as called by llResetOtherScript()). As with script stop (via llDie()) aborting other scripts event threads, llResetOtherScript() can also abort any current event thread on another script. On mono 2.6, 2.10 and possibly later this may cause locking problems in certain code areas. This commit reuses the recently introduced [XEngine] WaitForEventCompletionOnScriptStop to make this a 1 sec timeout, rather than 0 secs. --- .../ScriptEngine/Interfaces/IScriptInstance.cs | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Interfaces') diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 00a99c3..2f5b526 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs @@ -147,7 +147,13 @@ namespace OpenSim.Region.ScriptEngine.Interfaces /// /// Stop the script instance. /// + /// + /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise + /// there is a danger that it will self-abort and not complete the reset. + /// /// + /// How many milliseconds we will wait for an existing script event to finish before + /// forcibly aborting that event. /// true if the script was successfully stopped, false otherwise bool Stop(int timeout); @@ -169,8 +175,31 @@ namespace OpenSim.Region.ScriptEngine.Interfaces object EventProcessor(); int EventTime(); - void ResetScript(); + + /// + /// Reset the script. + /// + /// + /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise + /// there is a danger that it will self-abort and not complete the reset. Such a thread must call + /// ApiResetScript() instead. + /// + /// + /// How many milliseconds we will wait for an existing script event to finish before + /// forcibly aborting that event prior to script reset. + /// + void ResetScript(int timeout); + + /// + /// Reset the script. + /// + /// + /// This must not be called by any thread other than the one executing the scripts current event. This is + /// because there is no wait or abort logic if another thread is in the middle of processing a script event. + /// Such an external thread should use ResetScript() instead. + /// void ApiResetScript(); + Dictionary GetVars(); void SetVars(Dictionary vars); DetectParams GetDetectParams(int idx); -- cgit v1.1