aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorJohn Hurliman2010-09-10 12:04:12 -0700
committerJohn Hurliman2010-09-10 12:04:12 -0700
commitdd277a0d02f1aa79f4fcb5d108cbc696e90500c2 (patch)
tree7e396d347e43504ec23c59c3749f995f15c2e254 /OpenSim/Region/OptionalModules
parent* Run SimianGrid session updates asynchronously instead of from the main hear... (diff)
downloadopensim-SC-dd277a0d02f1aa79f4fcb5d108cbc696e90500c2.zip
opensim-SC-dd277a0d02f1aa79f4fcb5d108cbc696e90500c2.tar.gz
opensim-SC-dd277a0d02f1aa79f4fcb5d108cbc696e90500c2.tar.bz2
opensim-SC-dd277a0d02f1aa79f4fcb5d108cbc696e90500c2.tar.xz
First pass at cleaning up thread safety in EntityManager and SceneGraph
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs10
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs2
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs6
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs3
6 files changed, 13 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 6793ef6..159af79 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -375,8 +375,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
375 375
376 private void IRC_SendNamesReply() 376 private void IRC_SendNamesReply()
377 { 377 {
378 List<EntityBase> users = m_scene.Entities.GetAllByType<ScenePresence>(); 378 EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
379
380 foreach (EntityBase user in users) 379 foreach (EntityBase user in users)
381 { 380 {
382 SendServerCommand("353 " + m_nick + " = " + IrcRegionName + " :" + user.Name.Replace(" ", "")); 381 SendServerCommand("353 " + m_nick + " = " + IrcRegionName + " :" + user.Name.Replace(" ", ""));
@@ -386,8 +385,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
386 385
387 private void IRC_SendWhoReply() 386 private void IRC_SendWhoReply()
388 { 387 {
389 List<EntityBase> users = m_scene.Entities.GetAllByType<ScenePresence>(); 388 EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
390
391 foreach (EntityBase user in users) 389 foreach (EntityBase user in users)
392 { 390 {
393 /*SendServerCommand(String.Format("352 {0} {1} {2} {3} {4} {5} :0 {6}", IrcRegionName, 391 /*SendServerCommand(String.Format("352 {0} {1} {2} {3} {4} {5} :0 {6}", IrcRegionName,
@@ -415,11 +413,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
415 413
416 private void IRC_SendReplyUsers() 414 private void IRC_SendReplyUsers()
417 { 415 {
418 List<EntityBase> users = m_scene.Entities.GetAllByType<ScenePresence>(); 416 EntityBase[] users = m_scene.Entities.GetAllByType<ScenePresence>();
419 417
420 SendServerCommand("392 :UserID Terminal Host"); 418 SendServerCommand("392 :UserID Terminal Host");
421 419
422 if (users.Count == 0) 420 if (users.Length == 0)
423 { 421 {
424 SendServerCommand("395 :Nobody logged in"); 422 SendServerCommand("395 :Nobody logged in");
425 return; 423 return;
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs
index de1e01c..d21b652 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs
@@ -111,7 +111,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
111 } 111 }
112 112
113 // Check if there are SceneObjectGroups in the list that do not have corresponding ContentManagementGroups in the CMEntityHash 113 // Check if there are SceneObjectGroups in the list that do not have corresponding ContentManagementGroups in the CMEntityHash
114 public System.Collections.ArrayList CheckForMissingEntities(System.Collections.Generic.List<EntityBase> currList) 114 public System.Collections.ArrayList CheckForMissingEntities(EntityBase[] currList)
115 { 115 {
116 System.Collections.ArrayList missingList = new System.Collections.ArrayList(); 116 System.Collections.ArrayList missingList = new System.Collections.ArrayList();
117 SceneObjectGroup temp = null; 117 SceneObjectGroup temp = null;
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
index 2730eee..49d20e1 100644
--- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
127 /// </summary> 127 /// </summary>
128 public void FindDifferences() 128 public void FindDifferences()
129 { 129 {
130 System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities(); 130 List<EntityBase> sceneEntityList = new List<EntityBase>(m_Entity.Scene.GetEntities());
131 DiffersFromSceneGroup = false; 131 DiffersFromSceneGroup = false;
132 // if group is not contained in scene's list 132 // if group is not contained in scene's list
133 if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID)) 133 if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
index 6ba5ccf..140264b 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
@@ -41,12 +41,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
41 private readonly Scene m_scene; 41 private readonly Scene m_scene;
42 private readonly IEnumerator<EntityBase> m_sogEnum; 42 private readonly IEnumerator<EntityBase> m_sogEnum;
43 private readonly ISecurityCredential m_security; 43 private readonly ISecurityCredential m_security;
44 private readonly List<EntityBase> m_entities;
44 45
45 public IObjEnum(Scene scene, ISecurityCredential security) 46 public IObjEnum(Scene scene, ISecurityCredential security)
46 { 47 {
47 m_scene = scene; 48 m_scene = scene;
48 m_security = security; 49 m_security = security;
49 m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator(); 50 m_entities = new List<EntityBase>(m_scene.Entities.GetEntities());
51 m_sogEnum = m_entities.GetEnumerator();
50 } 52 }
51 53
52 public void Dispose() 54 public void Dispose()
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
index 45bb005..f2324d2 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
@@ -205,10 +205,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
205 { 205 {
206 get 206 get
207 { 207 {
208 List<EntityBase> ents = m_internalScene.Entities.GetAllByType<ScenePresence>(); 208 EntityBase[] ents = m_internalScene.Entities.GetAllByType<ScenePresence>();
209 IAvatar[] rets = new IAvatar[ents.Count]; 209 IAvatar[] rets = new IAvatar[ents.Length];
210 210
211 for (int i = 0; i < ents.Count; i++) 211 for (int i = 0; i < ents.Length; i++)
212 { 212 {
213 EntityBase ent = ents[i]; 213 EntityBase ent = ents[i];
214 rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security); 214 rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security);
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index 3ed338b..421da36 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -568,8 +568,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
568 { 568 {
569 m_copse = new List<Copse>(); 569 m_copse = new List<Copse>();
570 570
571 List<EntityBase> objs = m_scene.GetEntities(); 571 EntityBase[] objs = m_scene.GetEntities();
572
573 foreach (EntityBase obj in objs) 572 foreach (EntityBase obj in objs)
574 { 573 {
575 if (obj is SceneObjectGroup) 574 if (obj is SceneObjectGroup)