diff options
author | CasperW | 2009-12-06 17:23:07 +0100 |
---|---|---|
committer | CasperW | 2009-12-06 17:23:07 +0100 |
commit | 172e2f4e7609c278d02ad83ca207fd79624db587 (patch) | |
tree | 37c6d737e3fb8b3611efd4fa5dbaf38572128e51 /OpenSim | |
parent | Change EntityManager to use RWlocks (diff) | |
download | opensim-SC-172e2f4e7609c278d02ad83ca207fd79624db587.zip opensim-SC-172e2f4e7609c278d02ad83ca207fd79624db587.tar.gz opensim-SC-172e2f4e7609c278d02ad83ca207fd79624db587.tar.bz2 opensim-SC-172e2f4e7609c278d02ad83ca207fd79624db587.tar.xz |
Fix to existing ReaderWriterLockSlim implementations
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/TaskInventoryDictionary.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 10 |
4 files changed, 26 insertions, 7 deletions
diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index efe5f0c..4b9a509 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs | |||
@@ -109,7 +109,10 @@ namespace OpenSim.Framework | |||
109 | } | 109 | } |
110 | else | 110 | else |
111 | { | 111 | { |
112 | m_itemLock.ExitReadLock(); | 112 | if (m_itemLock.RecursiveReadCount>0) |
113 | { | ||
114 | m_itemLock.ExitReadLock(); | ||
115 | } | ||
113 | } | 116 | } |
114 | } | 117 | } |
115 | 118 | ||
@@ -144,7 +147,10 @@ namespace OpenSim.Framework | |||
144 | } | 147 | } |
145 | else | 148 | else |
146 | { | 149 | { |
147 | m_itemLock.ExitWriteLock(); | 150 | if (m_itemLock.RecursiveWriteCount > 0) |
151 | { | ||
152 | m_itemLock.ExitWriteLock(); | ||
153 | } | ||
148 | } | 154 | } |
149 | } | 155 | } |
150 | 156 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 93888f1..eacd219 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -126,7 +126,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
126 | } | 126 | } |
127 | else | 127 | else |
128 | { | 128 | { |
129 | m_partsLock.ExitReadLock(); | 129 | if (m_partsLock.RecursiveReadCount > 0) |
130 | { | ||
131 | m_partsLock.ExitReadLock(); | ||
132 | } | ||
130 | } | 133 | } |
131 | } | 134 | } |
132 | public void lockPartsForWrite(bool locked) | 135 | public void lockPartsForWrite(bool locked) |
@@ -155,7 +158,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
155 | } | 158 | } |
156 | else | 159 | else |
157 | { | 160 | { |
158 | m_partsLock.ExitWriteLock(); | 161 | if (m_partsLock.RecursiveWriteCount > 0) |
162 | { | ||
163 | m_partsLock.ExitWriteLock(); | ||
164 | } | ||
159 | } | 165 | } |
160 | } | 166 | } |
161 | 167 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 4780ff2..b57d912 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -320,17 +320,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
320 | { | 320 | { |
321 | if (m_items.ContainsKey(itemId)) | 321 | if (m_items.ContainsKey(itemId)) |
322 | { | 322 | { |
323 | m_items.LockItemsForRead(false); | ||
323 | CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); | 324 | CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); |
324 | } | 325 | } |
325 | else | 326 | else |
326 | { | 327 | { |
328 | m_items.LockItemsForRead(false); | ||
327 | m_log.ErrorFormat( | 329 | m_log.ErrorFormat( |
328 | "[PRIM INVENTORY]: " + | 330 | "[PRIM INVENTORY]: " + |
329 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", | 331 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", |
330 | itemId, m_part.Name, m_part.UUID, | 332 | itemId, m_part.Name, m_part.UUID, |
331 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | 333 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); |
332 | } | 334 | } |
333 | m_items.LockItemsForRead(false); | ||
334 | } | 335 | } |
335 | else | 336 | else |
336 | { | 337 | { |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 49c69ab..184af19 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -150,7 +150,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
150 | } | 150 | } |
151 | else | 151 | else |
152 | { | 152 | { |
153 | m_scriptsLock.ExitReadLock(); | 153 | if (m_scriptsLock.RecursiveReadCount > 0) |
154 | { | ||
155 | m_scriptsLock.ExitReadLock(); | ||
156 | } | ||
154 | } | 157 | } |
155 | } | 158 | } |
156 | private void lockScriptsForWrite(bool locked) | 159 | private void lockScriptsForWrite(bool locked) |
@@ -179,7 +182,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
179 | } | 182 | } |
180 | else | 183 | else |
181 | { | 184 | { |
182 | m_scriptsLock.ExitWriteLock(); | 185 | if (m_scriptsLock.RecursiveWriteCount > 0) |
186 | { | ||
187 | m_scriptsLock.ExitWriteLock(); | ||
188 | } | ||
183 | } | 189 | } |
184 | } | 190 | } |
185 | 191 | ||