diff options
author | Justin Clark-Casey (justincc) | 2015-01-16 23:55:00 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2015-01-16 23:55:11 +0000 |
commit | faaf47a86f34f24dec0d7d51eda638d0df3db305 (patch) | |
tree | 999a9351ae53e4ecc0b465e8e1bea744cb335837 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |
parent | For scripts in attachments, don't save .state files apart from the initial on... (diff) | |
download | opensim-SC_OLD-faaf47a86f34f24dec0d7d51eda638d0df3db305.zip opensim-SC_OLD-faaf47a86f34f24dec0d7d51eda638d0df3db305.tar.gz opensim-SC_OLD-faaf47a86f34f24dec0d7d51eda638d0df3db305.tar.bz2 opensim-SC_OLD-faaf47a86f34f24dec0d7d51eda638d0df3db305.tar.xz |
Prevent a race condition between the script engine backup thread and script removal by locking on the script's EventQueue and only proceeding if it's flagged as still running.
Relates to http://opensimulator.org/mantis/view.php?id=7407
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 03fafed..1a64595 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -732,8 +732,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
732 | 732 | ||
733 | // Clear the event queue and abort the instance thread | 733 | // Clear the event queue and abort the instance thread |
734 | // | 734 | // |
735 | instance.ClearQueue(); | 735 | instance.Stop(0, true); |
736 | instance.Stop(0); | ||
737 | 736 | ||
738 | // Release events, timer, etc | 737 | // Release events, timer, etc |
739 | // | 738 | // |
@@ -859,8 +858,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
859 | } | 858 | } |
860 | } | 859 | } |
861 | 860 | ||
862 | instances.Clear(); | ||
863 | |||
864 | if (saveTime > 0) | 861 | if (saveTime > 0) |
865 | m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup), | 862 | m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup), |
866 | new Object[] { saveTime }); | 863 | new Object[] { saveTime }); |
@@ -1443,6 +1440,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1443 | m_Scripts.Remove(itemID); | 1440 | m_Scripts.Remove(itemID); |
1444 | } | 1441 | } |
1445 | 1442 | ||
1443 | |||
1446 | instance.ClearQueue(); | 1444 | instance.ClearQueue(); |
1447 | 1445 | ||
1448 | instance.Stop(m_WaitForEventCompletionOnScriptStop); | 1446 | instance.Stop(m_WaitForEventCompletionOnScriptStop); |