minor: Add some method doc. Add warnings since calling SOG link/delink methods directly rather than through Scene may allow race conditions.

0.7.4.1
Justin Clark-Casey (justincc) 2012-04-17 23:54:51 +01:00
parent cca6b6bd0d
commit 859646ef5c
2 changed files with 22 additions and 0 deletions

View File

@ -91,6 +91,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
protected internal Dictionary<uint, SceneObjectGroup> SceneObjectGroupsByLocalPartID = new Dictionary<uint, SceneObjectGroup>();
/// <summary>
/// Lock to prevent object group update, linking and delinking operations from running concurrently.
/// </summary>
private Object m_updateLock = new Object();
#endregion

View File

@ -1962,6 +1962,10 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Link the prims in a given group to this group
/// </summary>
/// <remarks>
/// Do not call this method directly - use Scene.LinkObjects() instead to avoid races between threads.
/// FIXME: There are places where scripts call these methods directly without locking. This is a potential race condition.
/// </remarks>
/// <param name="objectGroup">The group of prims which should be linked to this group</param>
public void LinkToGroup(SceneObjectGroup objectGroup)
{
@ -2045,6 +2049,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Delink the given prim from this group. The delinked prim is established as
/// an independent SceneObjectGroup.
/// </summary>
/// <remarks>
/// FIXME: This method should not be called directly since it bypasses update locking, allowing a potential race
/// condition. But currently there is no
/// alternative method that does take a lonk to delink a single prim.
/// </remarks>
/// <param name="partID"></param>
/// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
public SceneObjectGroup DelinkFromGroup(uint partID)
@ -2056,6 +2065,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Delink the given prim from this group. The delinked prim is established as
/// an independent SceneObjectGroup.
/// </summary>
/// <remarks>
/// FIXME: This method should not be called directly since it bypasses update locking, allowing a potential race
/// condition. But currently there is no
/// alternative method that does take a lonk to delink a single prim.
/// </remarks>
/// <param name="partID"></param>
/// <param name="sendEvents"></param>
/// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
@ -2081,6 +2095,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Delink the given prim from this group. The delinked prim is established as
/// an independent SceneObjectGroup.
/// </summary>
/// <remarks>
/// FIXME: This method should not be called directly since it bypasses update locking, allowing a potential race
/// condition. But currently there is no
/// alternative method that does take a lonk to delink a single prim.
/// </remarks>
/// <param name="partID"></param>
/// <param name="sendEvents"></param>
/// <returns>The object group of the newly delinked prim.</returns>