mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
First pass at cleaning up thread safety in EntityManager and SceneGraph
This commit is contained in:
@@ -41,12 +41,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
private readonly Scene m_scene;
|
||||
private readonly IEnumerator<EntityBase> m_sogEnum;
|
||||
private readonly ISecurityCredential m_security;
|
||||
private readonly List<EntityBase> m_entities;
|
||||
|
||||
public IObjEnum(Scene scene, ISecurityCredential security)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_security = security;
|
||||
m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator();
|
||||
m_entities = new List<EntityBase>(m_scene.Entities.GetEntities());
|
||||
m_sogEnum = m_entities.GetEnumerator();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -205,10 +205,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
get
|
||||
{
|
||||
List<EntityBase> ents = m_internalScene.Entities.GetAllByType<ScenePresence>();
|
||||
IAvatar[] rets = new IAvatar[ents.Count];
|
||||
EntityBase[] ents = m_internalScene.Entities.GetAllByType<ScenePresence>();
|
||||
IAvatar[] rets = new IAvatar[ents.Length];
|
||||
|
||||
for (int i = 0; i < ents.Count; i++)
|
||||
for (int i = 0; i < ents.Length; i++)
|
||||
{
|
||||
EntityBase ent = ents[i];
|
||||
rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security);
|
||||
|
||||
Reference in New Issue
Block a user