diff options
author | Justin Clarke Casey | 2007-12-22 16:45:44 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2007-12-22 16:45:44 +0000 |
commit | ed0f8bd5728d0fbe992cc4a1d164983edda654e8 (patch) | |
tree | 071707a559b2600101cbfe241e289f75196d555a | |
parent | Put in some race revealing warning messages triggered when a user rezzes a sc... (diff) | |
download | opensim-SC-ed0f8bd5728d0fbe992cc4a1d164983edda654e8.zip opensim-SC-ed0f8bd5728d0fbe992cc4a1d164983edda654e8.tar.gz opensim-SC-ed0f8bd5728d0fbe992cc4a1d164983edda654e8.tar.bz2 opensim-SC-ed0f8bd5728d0fbe992cc4a1d164983edda654e8.tar.xz |
minor refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/BlockingQueue.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index dbd116b..a3cae63 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Framework | |||
34 | { | 34 | { |
35 | private Queue<T> _queue = new Queue<T>(); | 35 | private Queue<T> _queue = new Queue<T>(); |
36 | private object _queueSync = new object(); | 36 | private object _queueSync = new object(); |
37 | 37 | ||
38 | public void Enqueue(T value) | 38 | public void Enqueue(T value) |
39 | { | 39 | { |
40 | lock (_queueSync) | 40 | lock (_queueSync) |
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 99356c2..d1ff9c9 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -98,7 +98,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | public AssetBase GetAsset(LLUUID assetID) | 101 | /// <summary> |
102 | /// Only get an asset if we already have it in the cache. | ||
103 | /// </summary> | ||
104 | /// <param name="assetID"></param></param> | ||
105 | /// <returns></returns> | ||
106 | private AssetBase GetCachedAsset(LLUUID assetID) | ||
102 | { | 107 | { |
103 | AssetBase asset = null; | 108 | AssetBase asset = null; |
104 | if (Textures.ContainsKey(assetID)) | 109 | if (Textures.ContainsKey(assetID)) |
@@ -153,7 +158,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
153 | 158 | ||
154 | public AssetBase GetAsset(LLUUID assetID, bool isTexture) | 159 | public AssetBase GetAsset(LLUUID assetID, bool isTexture) |
155 | { | 160 | { |
156 | AssetBase asset = GetAsset(assetID); | 161 | AssetBase asset = GetCachedAsset(assetID); |
157 | if (asset == null) | 162 | if (asset == null) |
158 | { | 163 | { |
159 | m_assetServer.RequestAsset(assetID, isTexture); | 164 | m_assetServer.RequestAsset(assetID, isTexture); |
@@ -223,7 +228,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
223 | 228 | ||
224 | public AssetBase CopyAsset(LLUUID assetID) | 229 | public AssetBase CopyAsset(LLUUID assetID) |
225 | { | 230 | { |
226 | AssetBase asset = GetAsset(assetID); | 231 | AssetBase asset = GetCachedAsset(assetID); |
227 | if (asset == null) | 232 | if (asset == null) |
228 | return null; | 233 | return null; |
229 | 234 | ||
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 86591ec..34a9b09 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -3106,7 +3106,7 @@ namespace OpenSim.Region.ClientStack | |||
3106 | 3106 | ||
3107 | // Fetch landmark | 3107 | // Fetch landmark |
3108 | LLUUID lmid = tpReq.Info.LandmarkID; | 3108 | LLUUID lmid = tpReq.Info.LandmarkID; |
3109 | AssetBase lma = m_assetCache.GetAsset(lmid); | 3109 | AssetBase lma = m_assetCache.GetAsset(lmid, false); |
3110 | if (lma != null) | 3110 | if (lma != null) |
3111 | { | 3111 | { |
3112 | AssetLandmark lm = new AssetLandmark(lma); | 3112 | AssetLandmark lm = new AssetLandmark(lma); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 86cb38d..efd96d2 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -146,7 +146,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
146 | if (transactions != null) | 146 | if (transactions != null) |
147 | { | 147 | { |
148 | LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId); | 148 | LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId); |
149 | AssetBase asset = AssetCache.GetAsset(assetID); | 149 | AssetBase asset |
150 | = AssetCache.GetAsset( | ||
151 | assetID, (item.assetType == (int)AssetType.Texture ? true : false)); | ||
150 | 152 | ||
151 | if (asset == null) | 153 | if (asset == null) |
152 | { | 154 | { |