diff options
author | UbitUmarov | 2017-08-03 17:59:30 +0100 |
---|---|---|
committer | UbitUmarov | 2017-08-03 17:59:30 +0100 |
commit | f658b68181c6161520cfdf9537005c7415ea545a (patch) | |
tree | f5e5fa0cdb792c7e46a1d993511e0444e21078f7 /OpenSim/Region | |
parent | Oops fix also default UseMeshiesPhysicsMesh also on ubOde (diff) | |
download | opensim-SC-f658b68181c6161520cfdf9537005c7415ea545a.zip opensim-SC-f658b68181c6161520cfdf9537005c7415ea545a.tar.gz opensim-SC-f658b68181c6161520cfdf9537005c7415ea545a.tar.bz2 opensim-SC-f658b68181c6161520cfdf9537005c7415ea545a.tar.xz |
add a few locks
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 5efdd9b..7a4f981 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -250,7 +250,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
250 | if (inventoryURL != null && inventoryURL != string.Empty) | 250 | if (inventoryURL != null && inventoryURL != string.Empty) |
251 | { | 251 | { |
252 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); | 252 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); |
253 | m_InventoryURLs[userID] = inventoryURL; | 253 | lock (m_InventoryURLs) |
254 | m_InventoryURLs[userID] = inventoryURL; | ||
254 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); | 255 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); |
255 | return; | 256 | return; |
256 | } | 257 | } |
@@ -268,35 +269,42 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
268 | if (!string.IsNullOrEmpty(inventoryURL)) | 269 | if (!string.IsNullOrEmpty(inventoryURL)) |
269 | { | 270 | { |
270 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); | 271 | inventoryURL = inventoryURL.Trim(new char[] { '/' }); |
271 | m_InventoryURLs.Add(userID, inventoryURL); | 272 | lock (m_InventoryURLs) |
273 | m_InventoryURLs[userID] = inventoryURL; | ||
272 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); | 274 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL); |
273 | } | 275 | } |
274 | |||
275 | } | 276 | } |
276 | |||
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | private void DropInventoryServiceURL(UUID userID) | 280 | private void DropInventoryServiceURL(UUID userID) |
281 | { | 281 | { |
282 | lock (m_InventoryURLs) | 282 | lock (m_InventoryURLs) |
283 | { | ||
283 | if (m_InventoryURLs.ContainsKey(userID)) | 284 | if (m_InventoryURLs.ContainsKey(userID)) |
284 | { | 285 | { |
285 | string url = m_InventoryURLs[userID]; | 286 | string url = m_InventoryURLs[userID]; |
286 | m_InventoryURLs.Remove(userID); | 287 | m_InventoryURLs.Remove(userID); |
287 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url); | 288 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url); |
288 | } | 289 | } |
290 | } | ||
289 | } | 291 | } |
290 | 292 | ||
291 | public string GetInventoryServiceURL(UUID userID) | 293 | public string GetInventoryServiceURL(UUID userID) |
292 | { | 294 | { |
293 | if (m_InventoryURLs.ContainsKey(userID)) | 295 | lock (m_InventoryURLs) |
294 | return m_InventoryURLs[userID]; | 296 | { |
297 | if (m_InventoryURLs.ContainsKey(userID)) | ||
298 | return m_InventoryURLs[userID]; | ||
299 | } | ||
295 | 300 | ||
296 | CacheInventoryServiceURL(userID); | 301 | CacheInventoryServiceURL(userID); |
297 | 302 | ||
298 | if (m_InventoryURLs.ContainsKey(userID)) | 303 | lock (m_InventoryURLs) |
299 | return m_InventoryURLs[userID]; | 304 | { |
305 | if (m_InventoryURLs.ContainsKey(userID)) | ||
306 | return m_InventoryURLs[userID]; | ||
307 | } | ||
300 | 308 | ||
301 | return null; //it means that the methods should forward to local grid's inventory | 309 | return null; //it means that the methods should forward to local grid's inventory |
302 | 310 | ||