diff options
author | Justin Clark-Casey (justincc) | 2011-09-12 21:57:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-09-12 21:57:22 +0100 |
commit | ea0f78c97152d3aa54822487e5343ca2db0b47b9 (patch) | |
tree | 1496c7d6ebbed346209f1513f2affa3f1ba6f62a /OpenSim/Region/Framework/Interfaces | |
parent | lock AvatarAppearance.m_attachments when we use it (diff) | |
download | opensim-SC_OLD-ea0f78c97152d3aa54822487e5343ca2db0b47b9.zip opensim-SC_OLD-ea0f78c97152d3aa54822487e5343ca2db0b47b9.tar.gz opensim-SC_OLD-ea0f78c97152d3aa54822487e5343ca2db0b47b9.tar.bz2 opensim-SC_OLD-ea0f78c97152d3aa54822487e5343ca2db0b47b9.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Framework/Interfaces')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScenePresence.cs | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 73d15a5..e6ac6b5 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -88,6 +88,15 @@ namespace OpenSim.Region.Framework.Interfaces | |||
88 | ISceneEntity RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt); | 88 | ISceneEntity RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt); |
89 | 89 | ||
90 | /// <summary> | 90 | /// <summary> |
91 | /// Rez an attachment from user inventory and change inventory status to match. | ||
92 | /// </summary> | ||
93 | /// <param name="sp"></param> | ||
94 | /// <param name="itemID"></param> | ||
95 | /// <param name="AttachmentPt"></param> | ||
96 | /// <returns>The scene object that was attached. Null if the scene object could not be found</returns> | ||
97 | ISceneEntity RezSingleAttachmentFromInventory(ScenePresence sp, UUID itemID, uint AttachmentPt); | ||
98 | |||
99 | /// <summary> | ||
91 | /// Rez multiple attachments from a user's inventory | 100 | /// Rez multiple attachments from a user's inventory |
92 | /// </summary> | 101 | /// </summary> |
93 | /// <param name="remoteClient"></param> | 102 | /// <param name="remoteClient"></param> |
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 | |||
61 | AvatarAppearance Appearance { get; set; } | 61 | AvatarAppearance Appearance { get; set; } |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// The AttachmentsModule synchronizes on this to avoid race conditions between commands to add and remove attachments. | ||
65 | /// </summary> | ||
66 | /// <remarks> | ||
67 | /// All add and remove attachment operations must synchronize on this for the lifetime of their operations. | ||
68 | /// </remarks> | ||
69 | Object AttachmentsSyncLock { get; } | ||
70 | |||
71 | /// <summary> | ||
64 | /// The scene objects attached to this avatar. | 72 | /// The scene objects attached to this avatar. |
65 | /// </summary> | 73 | /// </summary> |
66 | /// <returns> | 74 | /// <returns> |