aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2010-07-19 16:22:29 -0700
committerDiva Canto2010-07-19 16:22:29 -0700
commitc0d9ab941dd1ab88f00f6d4f2a53a4fe5c605e57 (patch)
tree138ec8448371528db3107db9b5c2f689e0f98fc0
parentAnother stab at http://opensimulator.org/mantis/view.php?id=4858. Eliminated ... (diff)
downloadopensim-SC-c0d9ab941dd1ab88f00f6d4f2a53a4fe5c605e57.zip
opensim-SC-c0d9ab941dd1ab88f00f6d4f2a53a4fe5c605e57.tar.gz
opensim-SC-c0d9ab941dd1ab88f00f6d4f2a53a4fe5c605e57.tar.bz2
opensim-SC-c0d9ab941dd1ab88f00f6d4f2a53a4fe5c605e57.tar.xz
Reverting this for now, but this needs to go in again.
Revert "Another stab at http://opensimulator.org/mantis/view.php?id=4858. Eliminated more nested locks." This reverts commit ffbae52a130376ecaa04d7d475709985c62c06ed.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs64
1 files changed, 28 insertions, 36 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index b050349..c436582 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -701,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
701 } 701 }
702 } 702 }
703 703
704 ScriptInstance instance = null;
705 lock (m_Scripts) 704 lock (m_Scripts)
706 { 705 {
706 ScriptInstance instance = null;
707 // Create the object record 707 // Create the object record
708 708
709 if ((!m_Scripts.ContainsKey(itemID)) || 709 if ((!m_Scripts.ContainsKey(itemID)) ||
@@ -786,29 +786,28 @@ namespace OpenSim.Region.ScriptEngine.XEngine
786 786
787 m_Scripts[itemID] = instance; 787 m_Scripts[itemID] = instance;
788 } 788 }
789 }
790 789
791 lock (m_PrimObjects) 790 lock (m_PrimObjects)
792 { 791 {
793 if (!m_PrimObjects.ContainsKey(localID)) 792 if (!m_PrimObjects.ContainsKey(localID))
794 m_PrimObjects[localID] = new List<UUID>(); 793 m_PrimObjects[localID] = new List<UUID>();
795 794
796 if (!m_PrimObjects[localID].Contains(itemID)) 795 if (!m_PrimObjects[localID].Contains(itemID))
797 m_PrimObjects[localID].Add(itemID); 796 m_PrimObjects[localID].Add(itemID);
798 797
799 } 798 }
800 799
801 if (!m_Assemblies.ContainsKey(assetID)) 800 if (!m_Assemblies.ContainsKey(assetID))
802 m_Assemblies[assetID] = assembly; 801 m_Assemblies[assetID] = assembly;
803 802
804 lock (m_AddingAssemblies) 803 lock (m_AddingAssemblies)
805 { 804 {
806 m_AddingAssemblies[assembly]--; 805 m_AddingAssemblies[assembly]--;
807 } 806 }
808
809 if (instance != null)
810 instance.Init();
811 807
808 if (instance!=null)
809 instance.Init();
810 }
812 return true; 811 return true;
813 } 812 }
814 813
@@ -1008,33 +1007,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1008 public bool PostObjectEvent(uint localID, EventParams p) 1007 public bool PostObjectEvent(uint localID, EventParams p)
1009 { 1008 {
1010 bool result = false; 1009 bool result = false;
1011 List<UUID> uuids = null; 1010
1012
1013 lock (m_PrimObjects) 1011 lock (m_PrimObjects)
1014 { 1012 {
1015 if (!m_PrimObjects.ContainsKey(localID)) 1013 if (!m_PrimObjects.ContainsKey(localID))
1016 return false; 1014 return false;
1017 1015
1018 uuids = m_PrimObjects[localID]; 1016
1019 } 1017 foreach (UUID itemID in m_PrimObjects[localID])
1020
1021 foreach (UUID itemID in uuids)
1022 {
1023 IScriptInstance instance = null;
1024 try
1025 { 1018 {
1026 if (m_Scripts.ContainsKey(itemID)) 1019 if (m_Scripts.ContainsKey(itemID))
1027 instance = m_Scripts[itemID]; 1020 {
1028 } 1021 IScriptInstance instance = m_Scripts[itemID];
1029 catch { /* ignore race conditions */ } 1022 if (instance != null)
1030 1023 {
1031 if (instance != null) 1024 instance.PostEvent(p);
1032 { 1025 result = true;
1033 instance.PostEvent(p); 1026 }
1034 result = true; 1027 }
1035 } 1028 }
1036 } 1029 }
1037
1038 return result; 1030 return result;
1039 } 1031 }
1040 1032