* Removed more locks on Entities
* Entities should now in theory be lock-free externally. * Other properties may cause blocking however[?]. * ScenePresence maintains separate locks so isn't fixed by this commit.0.6.1-post-fixes
							parent
							
								
									2305ef61a5
								
							
						
					
					
						commit
						2a8ff937d5
					
				| 
						 | 
				
			
			@ -664,16 +664,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
 | 
			
		|||
        public void UpdateLandPrimCounts()
 | 
			
		||||
        {
 | 
			
		||||
            ResetAllLandPrimCounts();
 | 
			
		||||
            lock (m_scene.Entities)
 | 
			
		||||
            foreach (EntityBase obj in m_scene.Entities)
 | 
			
		||||
            {
 | 
			
		||||
                foreach (EntityBase obj in m_scene.Entities)
 | 
			
		||||
                if (obj != null)
 | 
			
		||||
                {
 | 
			
		||||
                    if (obj != null)
 | 
			
		||||
                    if ((obj is SceneObjectGroup) && !obj.IsDeleted && !((SceneObjectGroup) obj).IsAttachment)
 | 
			
		||||
                    {
 | 
			
		||||
                        if ((obj is SceneObjectGroup) && !((SceneObjectGroup)obj).IsDeleted && !((SceneObjectGroup)obj).IsAttachment)
 | 
			
		||||
                        {
 | 
			
		||||
                            m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
 | 
			
		||||
                        }
 | 
			
		||||
                        m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup) obj);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -244,21 +244,6 @@ namespace OpenSim.Region.Environment.Scenes
 | 
			
		|||
        //            set { m_sceneGraph.SceneObjects = value; }
 | 
			
		||||
        //        }
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// The dictionary of all entities in this scene.  The contents of this dictionary may be changed at any time.
 | 
			
		||||
        /// If you wish to add or remove entities, please use the appropriate method for that entity rather than
 | 
			
		||||
        /// editing this dictionary directly.
 | 
			
		||||
        ///
 | 
			
		||||
        /// If you want a list of entities where the list itself is guaranteed not to change, please use
 | 
			
		||||
        /// GetEntities()
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public Dictionary<UUID, EntityBase> Entities
 | 
			
		||||
        {
 | 
			
		||||
            get { return m_sceneGraph.Entities; }
 | 
			
		||||
            set { m_sceneGraph.Entities = value; }
 | 
			
		||||
        }
 | 
			
		||||
        */
 | 
			
		||||
        public EntityManager Entities
 | 
			
		||||
        {
 | 
			
		||||
            get { return m_sceneGraph.Entities; }
 | 
			
		||||
| 
						 | 
				
			
			@ -609,14 +594,11 @@ namespace OpenSim.Region.Environment.Scenes
 | 
			
		|||
                if (ScriptEngine)
 | 
			
		||||
                {
 | 
			
		||||
                    m_log.Info("Stopping all Scripts in Scene");
 | 
			
		||||
                    lock (Entities)
 | 
			
		||||
                    foreach (EntityBase ent in Entities)
 | 
			
		||||
                    {
 | 
			
		||||
                        foreach (EntityBase ent in Entities)
 | 
			
		||||
                        if (ent is SceneObjectGroup)
 | 
			
		||||
                        {
 | 
			
		||||
                            if (ent is SceneObjectGroup)
 | 
			
		||||
                            {
 | 
			
		||||
                                ((SceneObjectGroup)ent).RemoveScriptInstances();
 | 
			
		||||
                            }
 | 
			
		||||
                            ((SceneObjectGroup) ent).RemoveScriptInstances();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -788,10 +788,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
 | 
			
		|||
            }
 | 
			
		||||
 | 
			
		||||
            EntityBase SensedObject;
 | 
			
		||||
            lock (World.Entities)
 | 
			
		||||
            {
 | 
			
		||||
                World.Entities.TryGetValue(objecUUID, out SensedObject);
 | 
			
		||||
            }
 | 
			
		||||
            World.Entities.TryGetValue(objecUUID, out SensedObject);
 | 
			
		||||
 | 
			
		||||
            if (SensedObject == null)
 | 
			
		||||
                return String.Empty;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue