aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-07 19:33:20 +0000
committerJustin Clarke Casey2009-01-07 19:33:20 +0000
commit9e297cd7228e56255039929f710e52a0590c74e4 (patch)
tree58b1baf13e8571ee3e5fbdc9acaf808eb773c6c2
parent* Apply http://opensimulator.org/mantis/view.php?id=2948 (diff)
downloadopensim-SC-9e297cd7228e56255039929f710e52a0590c74e4.zip
opensim-SC-9e297cd7228e56255039929f710e52a0590c74e4.tar.gz
opensim-SC-9e297cd7228e56255039929f710e52a0590c74e4.tar.bz2
opensim-SC-9e297cd7228e56255039929f710e52a0590c74e4.tar.xz
* Slightly increase ScenePresences locking where it's technically required in SceneGraph
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneGraph.cs42
1 files changed, 25 insertions, 17 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
index 26fe40a..be2fb46 100644
--- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
@@ -837,7 +837,11 @@ namespace OpenSim.Region.Environment.Scenes
837 protected internal ScenePresence GetScenePresence(UUID agentID) 837 protected internal ScenePresence GetScenePresence(UUID agentID)
838 { 838 {
839 ScenePresence sp; 839 ScenePresence sp;
840 ScenePresences.TryGetValue(agentID, out sp); 840
841 lock (ScenePresences)
842 {
843 ScenePresences.TryGetValue(agentID, out sp);
844 }
841 845
842 return sp; 846 return sp;
843 } 847 }
@@ -968,22 +972,26 @@ namespace OpenSim.Region.Environment.Scenes
968 protected internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) 972 protected internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
969 { 973 {
970 ScenePresence presence; 974 ScenePresence presence;
971 if (ScenePresences.TryGetValue(avatarId, out presence)) 975
976 lock (ScenePresences)
972 { 977 {
973 avatar = presence; 978 if (ScenePresences.TryGetValue(avatarId, out presence))
974 return true; 979 {
980 avatar = presence;
981 return true;
975 982
976 //if (!presence.IsChildAgent) 983 //if (!presence.IsChildAgent)
977 //{ 984 //{
978 // avatar = presence; 985 // avatar = presence;
979 // return true; 986 // return true;
980 //} 987 //}
981 //else 988 //else
982 //{ 989 //{
983 // m_log.WarnFormat( 990 // m_log.WarnFormat(
984 // "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!", 991 // "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!",
985 // avatarId, m_parentScene.RegionInfo.RegionName); 992 // avatarId, m_parentScene.RegionInfo.RegionName);
986 //} 993 //}
994 }
987 } 995 }
988 996
989 avatar = null; 997 avatar = null;
@@ -1477,13 +1485,13 @@ namespace OpenSim.Region.Environment.Scenes
1477 1485
1478 // We need to explicitly resend the newly link prim's object properties since no other actions 1486 // We need to explicitly resend the newly link prim's object properties since no other actions
1479 // occur on link to invoke this elsewhere (such as object selection) 1487 // occur on link to invoke this elsewhere (such as object selection)
1480 parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected); 1488 parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
1481 parenPrim.TriggerScriptChangedEvent(Changed.LINK); 1489 parenPrim.TriggerScriptChangedEvent(Changed.LINK);
1482 if (client != null) 1490 if (client != null)
1483 parenPrim.GetProperties(client); 1491 parenPrim.GetProperties(client);
1484 else 1492 else
1485 { 1493 {
1486 foreach (ScenePresence p in ScenePresences.Values) 1494 foreach (ScenePresence p in GetScenePresences())
1487 { 1495 {
1488 parenPrim.GetProperties(p.ControllingClient); 1496 parenPrim.GetProperties(p.ControllingClient);
1489 } 1497 }