Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
commit
e53b62304f
|
@ -62,6 +62,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
// count. The entries are removed when the interest count reaches 0.
|
// count. The entries are removed when the interest count reaches 0.
|
||||||
Dictionary<UUID,UUID> classifiedCache = new Dictionary<UUID, UUID>();
|
Dictionary<UUID,UUID> classifiedCache = new Dictionary<UUID, UUID>();
|
||||||
Dictionary<UUID,int> classifiedInterest = new Dictionary<UUID, int>();
|
Dictionary<UUID,int> classifiedInterest = new Dictionary<UUID, int>();
|
||||||
|
Object classifiedLock;
|
||||||
|
|
||||||
public Scene Scene
|
public Scene Scene
|
||||||
{
|
{
|
||||||
|
@ -329,11 +330,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
|
|
||||||
if(!classifiedCache.ContainsKey(cid))
|
if(!classifiedCache.ContainsKey(cid))
|
||||||
{
|
{
|
||||||
classifiedCache.Add(cid,creatorId);
|
lock(classifiedCache)
|
||||||
classifiedInterest.Add(cid, 0);
|
classifiedCache.Add(cid,creatorId);
|
||||||
|
lock(classifiedInterest)
|
||||||
|
classifiedInterest.Add(cid, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
classifiedInterest[cid] ++;
|
lock(classifiedInterest)
|
||||||
|
classifiedInterest[cid] ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds);
|
remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds);
|
||||||
|
@ -349,20 +353,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
{
|
{
|
||||||
target = classifiedCache[queryClassifiedID];
|
target = classifiedCache[queryClassifiedID];
|
||||||
|
|
||||||
if(classifiedInterest[queryClassifiedID] -- == 0)
|
lock(classifiedInterest)
|
||||||
|
classifiedInterest[queryClassifiedID] --;
|
||||||
|
|
||||||
|
if(classifiedInterest[queryClassifiedID] == 0)
|
||||||
{
|
{
|
||||||
|
lock(classifiedInterest)
|
||||||
|
classifiedInterest.Remove(queryClassifiedID);
|
||||||
lock(classifiedCache)
|
lock(classifiedCache)
|
||||||
{
|
|
||||||
lock(classifiedInterest)
|
|
||||||
{
|
|
||||||
classifiedInterest.Remove(queryClassifiedID);
|
|
||||||
}
|
|
||||||
classifiedCache.Remove(queryClassifiedID);
|
classifiedCache.Remove(queryClassifiedID);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string serverURI = string.Empty;
|
string serverURI = string.Empty;
|
||||||
bool foreign = GetUserProfileServerURI(target, out serverURI);
|
bool foreign = GetUserProfileServerURI(target, out serverURI);
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is
|
/// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is
|
||||||
/// necessary.
|
/// necessary.
|
||||||
|
/// NOTE: To avoid deadlocks, do not lock m_attachments and then perform other tasks under that lock. Take a copy
|
||||||
|
/// of the list and act on that instead.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
|
private List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
|
||||||
|
|
||||||
|
@ -971,19 +973,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
|
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
|
||||||
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
|
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
|
||||||
// not transporting the required data.
|
// not transporting the required data.
|
||||||
lock (m_attachments)
|
//
|
||||||
{
|
// We must take a copy of the attachments list here (rather than locking) to avoid a deadlock where a script in one of
|
||||||
if (HasAttachments())
|
// the attachments may start processing an event (which locks ScriptInstance.m_Script) that then calls a method here
|
||||||
{
|
// which needs to lock m_attachments. ResumeScripts() needs to take a ScriptInstance.m_Script lock to try to unset the Suspend status.
|
||||||
m_log.DebugFormat(
|
//
|
||||||
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
// FIXME: In theory, this deadlock should not arise since scripts should not be processing events until ResumeScripts().
|
||||||
|
// But XEngine starts all scripts unsuspended. Starting them suspended will not currently work because script rezzing
|
||||||
|
// is placed in an asynchronous queue in XEngine and so the ResumeScripts() call will almost certainly execute before the
|
||||||
|
// script is rezzed. This means the ResumeScripts() does absolutely nothing when using XEngine.
|
||||||
|
List<SceneObjectGroup> attachments = GetAttachments();
|
||||||
|
|
||||||
// Resume scripts
|
if (attachments.Count > 0)
|
||||||
foreach (SceneObjectGroup sog in m_attachments)
|
{
|
||||||
{
|
m_log.DebugFormat(
|
||||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||||
sog.ResumeScripts();
|
|
||||||
}
|
// Resume scripts
|
||||||
|
foreach (SceneObjectGroup sog in attachments)
|
||||||
|
{
|
||||||
|
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||||
|
sog.ResumeScripts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -360,7 +360,7 @@ public static class BSParam
|
||||||
new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat",
|
new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat",
|
||||||
false ),
|
false ),
|
||||||
new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval",
|
new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval",
|
||||||
0.1f ),
|
0.089f ),
|
||||||
|
|
||||||
new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties",
|
new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties",
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -389,9 +389,21 @@ public class BSShapeMesh : BSShape
|
||||||
}
|
}
|
||||||
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
||||||
{
|
{
|
||||||
// Another reference to this shape is just counted.
|
BSShape ret = null;
|
||||||
IncrementReference();
|
// If the underlying shape is native, the actual shape has not been build (waiting for asset)
|
||||||
return this;
|
// and we must create a copy of the native shape since they are never shared.
|
||||||
|
if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape)
|
||||||
|
{
|
||||||
|
// TODO: decide when the native shapes should be freed. Check in Dereference?
|
||||||
|
ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Another reference to this shape is just counted.
|
||||||
|
IncrementReference();
|
||||||
|
ret = this;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
public override void Dereference(BSScene physicsScene)
|
public override void Dereference(BSScene physicsScene)
|
||||||
{
|
{
|
||||||
|
@ -560,9 +572,21 @@ public class BSShapeHull : BSShape
|
||||||
}
|
}
|
||||||
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
||||||
{
|
{
|
||||||
// Another reference to this shape is just counted.
|
BSShape ret = null;
|
||||||
IncrementReference();
|
// If the underlying shape is native, the actual shape has not been build (waiting for asset)
|
||||||
return this;
|
// and we must create a copy of the native shape since they are never shared.
|
||||||
|
if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape)
|
||||||
|
{
|
||||||
|
// TODO: decide when the native shapes should be freed. Check in Dereference?
|
||||||
|
ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Another reference to this shape is just counted.
|
||||||
|
IncrementReference();
|
||||||
|
ret = this;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
public override void Dereference(BSScene physicsScene)
|
public override void Dereference(BSScene physicsScene)
|
||||||
{
|
{
|
||||||
|
@ -1075,12 +1099,23 @@ public class BSShapeGImpact : BSShape
|
||||||
(w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) );
|
(w, iC, i, vC, v) => physicsScene.PE.CreateGImpactShape(w, iC, i, vC, v) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BSShape GetReference(BSScene physicsScene, BSPhysObject prim)
|
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
||||||
{
|
{
|
||||||
// Calling this reference means we want another handle to an existing shape
|
BSShape ret = null;
|
||||||
// (usually linksets) so return this copy.
|
// If the underlying shape is native, the actual shape has not been build (waiting for asset)
|
||||||
IncrementReference();
|
// and we must create a copy of the native shape since they are never shared.
|
||||||
return this;
|
if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape)
|
||||||
|
{
|
||||||
|
// TODO: decide when the native shapes should be freed. Check in Dereference?
|
||||||
|
ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Another reference to this shape is just counted.
|
||||||
|
IncrementReference();
|
||||||
|
ret = this;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
// Dereferencing a compound shape releases the hold on all the child shapes.
|
// Dereferencing a compound shape releases the hold on all the child shapes.
|
||||||
public override void Dereference(BSScene physicsScene)
|
public override void Dereference(BSScene physicsScene)
|
||||||
|
|
Loading…
Reference in New Issue