From ea0f78c97152d3aa54822487e5343ca2db0b47b9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 Sep 2011 21:57:22 +0100
Subject: 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.
---
OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'OpenSim/Region/Framework/Interfaces/IScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
index 8913133..95688ab 100644
--- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
@@ -61,6 +61,14 @@ namespace OpenSim.Region.Framework.Interfaces
AvatarAppearance Appearance { get; set; }
///
+ /// The AttachmentsModule synchronizes on this to avoid race conditions between commands to add and remove attachments.
+ ///
+ ///
+ /// All add and remove attachment operations must synchronize on this for the lifetime of their operations.
+ ///
+ Object AttachmentsSyncLock { get; }
+
+ ///
/// The scene objects attached to this avatar.
///
///
--
cgit v1.1