If a script is being stopped manually, then give the scriptpool thread 1 second to finish normally before forcibly aborting.

This is to avoid the worst of the problems in mono 2.6, 2.10 where an aborted thread does not always release all its locks.
This very short grace period is identical to the existing behaviour when a script is removed from the scene.
0.7.3-extended
Justin Clark-Casey (justincc) 2012-07-10 21:42:51 +01:00
parent 596caf41db
commit 35457448ca
1 changed files with 5 additions and 1 deletions

View File

@ -1567,7 +1567,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
IScriptInstance instance = GetInstance(itemID); IScriptInstance instance = GetInstance(itemID);
if (instance != null) if (instance != null)
instance.Stop(0); {
// Give the script some time to finish processing its last event. Simply aborting the script thread can
// cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort.
instance.Stop(1000);
}
} }
public DetectParams GetDetectParams(UUID itemID, int idx) public DetectParams GetDetectParams(UUID itemID, int idx)