diff options
author | Justin Clarke Casey | 2008-07-06 12:46:17 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-06 12:46:17 +0000 |
commit | 666626db6d1feeeafafc2c145127f80c7981fc3d (patch) | |
tree | 03d8371a1f63ac7cff8ff13f5d4de8bd35a39e1e /OpenSim/Region/Environment | |
parent | * minor: Stop spurious 'item not found' messages when placing things into a p... (diff) | |
download | opensim-SC_OLD-666626db6d1feeeafafc2c145127f80c7981fc3d.zip opensim-SC_OLD-666626db6d1feeeafafc2c145127f80c7981fc3d.tar.gz opensim-SC_OLD-666626db6d1feeeafafc2c145127f80c7981fc3d.tar.bz2 opensim-SC_OLD-666626db6d1feeeafafc2c145127f80c7981fc3d.tar.xz |
* minor: remove unnecessary locking from SOP.GetInventoryItem()
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 7e43b44..27b00ee 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -43,9 +43,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
43 | 43 | ||
44 | private string m_inventoryFileName = String.Empty; | 44 | private string m_inventoryFileName = String.Empty; |
45 | private int m_inventoryFileNameSerial = 0; | 45 | private int m_inventoryFileNameSerial = 0; |
46 | |||
47 | 46 | ||
48 | |||
49 | /// <summary> | 47 | /// <summary> |
50 | /// Serial count for inventory file , used to tell if inventory has changed | 48 | /// Serial count for inventory file , used to tell if inventory has changed |
51 | /// no need for this to be part of Database backup | 49 | /// no need for this to be part of Database backup |
@@ -56,9 +54,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
56 | /// <summary> | 54 | /// <summary> |
57 | /// Holds in memory prim inventory | 55 | /// Holds in memory prim inventory |
58 | /// </summary> | 56 | /// </summary> |
59 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); | 57 | protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary(); |
60 | |||
61 | |||
62 | 58 | ||
63 | /// <summary> | 59 | /// <summary> |
64 | /// Tracks whether inventory has changed since the last persistent backup | 60 | /// Tracks whether inventory has changed since the last persistent backup |
@@ -345,21 +341,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
345 | /// </summary> | 341 | /// </summary> |
346 | /// <param name="itemID"></param> | 342 | /// <param name="itemID"></param> |
347 | /// <returns>null if the item does not exist</returns> | 343 | /// <returns>null if the item does not exist</returns> |
348 | public TaskInventoryItem GetInventoryItem(LLUUID itemID) | 344 | public TaskInventoryItem GetInventoryItem(LLUUID itemId) |
349 | { | 345 | { |
350 | lock (m_taskInventory) | 346 | TaskInventoryItem item; |
351 | { | 347 | m_taskInventory.TryGetValue(itemId, out item); |
352 | if (m_taskInventory.ContainsKey(itemID)) | 348 | |
353 | { | 349 | return item; |
354 | // m_log.DebugFormat( | ||
355 | // "[PRIM INVENTORY]: Retrieved task inventory item {0}, {1} from prim {2}, {3}", | ||
356 | // m_taskInventory[itemID].Name, itemID, Name, UUID); | ||
357 | |||
358 | return m_taskInventory[itemID]; | ||
359 | } | ||
360 | } | ||
361 | |||
362 | return null; | ||
363 | } | 350 | } |
364 | 351 | ||
365 | /// <summary> | 352 | /// <summary> |
@@ -367,7 +354,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
367 | /// </summary> | 354 | /// </summary> |
368 | /// <param name="item">The updated item. An item with the same id must already exist | 355 | /// <param name="item">The updated item. An item with the same id must already exist |
369 | /// in this prim's inventory.</param> | 356 | /// in this prim's inventory.</param> |
370 | /// <returns>false if the item did not exist, true if the update occurred succesfully</returns> | 357 | /// <returns>false if the item did not exist, true if the update occurred successfully</returns> |
371 | public bool UpdateInventoryItem(TaskInventoryItem item) | 358 | public bool UpdateInventoryItem(TaskInventoryItem item) |
372 | { | 359 | { |
373 | lock (m_taskInventory) | 360 | lock (m_taskInventory) |