diff options
author | UbitUmarov | 2018-12-28 21:12:19 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-28 21:12:19 +0000 |
commit | 00278f7258113d5520c7ff85345e7243a9ebc838 (patch) | |
tree | a850386c8a86d7bef287acc2c3a5beca4df29476 | |
parent | PGSQL: it may be a good idea to also add the field to the table (diff) | |
download | opensim-SC-00278f7258113d5520c7ff85345e7243a9ebc838.zip opensim-SC-00278f7258113d5520c7ff85345e7243a9ebc838.tar.gz opensim-SC-00278f7258113d5520c7ff85345e7243a9ebc838.tar.bz2 opensim-SC-00278f7258113d5520c7ff85345e7243a9ebc838.tar.xz |
remove silly double locking
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a78ed8b..9c3f166 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -5468,15 +5468,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
5468 | // this scales bad but so does GetLinkNumPart | 5468 | // this scales bad but so does GetLinkNumPart |
5469 | public int GetLinkNumber(string name) | 5469 | public int GetLinkNumber(string name) |
5470 | { | 5470 | { |
5471 | if(String.IsNullOrEmpty(name) || name == "Object") | 5471 | if(String.IsNullOrEmpty(name) || name == "Object" || name == "Primitive") |
5472 | return -1; | 5472 | return -1; |
5473 | 5473 | ||
5474 | lock(m_partsNameToLinkMap) | 5474 | lock(m_partsNameToLinkMap) |
5475 | { | 5475 | { |
5476 | if(m_partsNameToLinkMap.Count == 0) | 5476 | if (name == GetLinkNumber_lastname) |
5477 | return GetLinkNumber_lastnumber; | ||
5478 | |||
5479 | if (m_partsNameToLinkMap.Count == 0) | ||
5477 | { | 5480 | { |
5478 | GetLinkNumber_lastname = String.Empty; | 5481 | GetLinkNumber_lastname = String.Empty; |
5479 | GetLinkNumber_lastnumber = -1; | 5482 | GetLinkNumber_lastnumber = -1; |
5483 | |||
5480 | SceneObjectPart[] parts = m_parts.GetArray(); | 5484 | SceneObjectPart[] parts = m_parts.GetArray(); |
5481 | for (int i = 0; i < parts.Length; i++) | 5485 | for (int i = 0; i < parts.Length; i++) |
5482 | { | 5486 | { |
@@ -5495,19 +5499,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
5495 | } | 5499 | } |
5496 | } | 5500 | } |
5497 | 5501 | ||
5498 | if(name == GetLinkNumber_lastname) | ||
5499 | return GetLinkNumber_lastnumber; | ||
5500 | |||
5501 | if(m_partsNameToLinkMap.ContainsKey(name)) | 5502 | if(m_partsNameToLinkMap.ContainsKey(name)) |
5502 | { | 5503 | { |
5503 | lock(m_partsNameToLinkMap) | 5504 | GetLinkNumber_lastname = name; |
5504 | { | 5505 | GetLinkNumber_lastnumber = m_partsNameToLinkMap[name]; |
5505 | GetLinkNumber_lastname = name; | 5506 | return GetLinkNumber_lastnumber; |
5506 | GetLinkNumber_lastnumber = m_partsNameToLinkMap[name]; | ||
5507 | return GetLinkNumber_lastnumber; | ||
5508 | } | ||
5509 | } | 5507 | } |
5510 | } | 5508 | } |
5511 | 5509 | ||
5512 | if(m_sittingAvatars.Count > 0) | 5510 | if(m_sittingAvatars.Count > 0) |
5513 | { | 5511 | { |