mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
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
This commit is contained in:
@@ -732,8 +732,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
// Clear the event queue and abort the instance thread
|
||||
//
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
instance.Stop(0, true);
|
||||
|
||||
// Release events, timer, etc
|
||||
//
|
||||
@@ -859,8 +858,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
instances.Clear();
|
||||
|
||||
if (saveTime > 0)
|
||||
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup),
|
||||
new Object[] { saveTime });
|
||||
@@ -1443,6 +1440,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
m_Scripts.Remove(itemID);
|
||||
}
|
||||
|
||||
|
||||
instance.ClearQueue();
|
||||
|
||||
instance.Stop(m_WaitForEventCompletionOnScriptStop);
|
||||
|
||||
Reference in New Issue
Block a user