mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Start locking entire add/remove operations on an IScenePresence.AttachmentsSyncLock object
Attach and detach packets are processed asynchronously when received from a viewer. Bugs like http://opensimulator.org/mantis/view.php?id=5644 indicate that in some situations (such as attaching/detaching entire folders of objects at once), there are race conditions between these threads. Since multiple data structures need to be updated on attach/detach, it's not enough to lock the individual collections. Therefore, this commit introduces a new IScenePresence.AttachmentsSyncLock which add/remove operations lock on.
This commit is contained in:
@@ -120,6 +120,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </remarks>
|
||||
protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
|
||||
|
||||
public Object AttachmentsSyncLock { get; private set; }
|
||||
|
||||
private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>();
|
||||
private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO;
|
||||
private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO;
|
||||
@@ -709,6 +711,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public ScenePresence(
|
||||
IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance, PresenceType type)
|
||||
{
|
||||
AttachmentsSyncLock = new Object();
|
||||
|
||||
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
|
||||
m_sceneViewer = new SceneViewer(this);
|
||||
m_animator = new ScenePresenceAnimator(this);
|
||||
|
||||
Reference in New Issue
Block a user