From ed0f8bd5728d0fbe992cc4a1d164983edda654e8 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 22 Dec 2007 16:45:44 +0000 Subject: minor refactor --- OpenSim/Framework/BlockingQueue.cs | 2 +- OpenSim/Framework/Communications/Cache/AssetCache.cs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') 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 { private Queue _queue = new Queue(); private object _queueSync = new object(); - + public void Enqueue(T value) { 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 } } - public AssetBase GetAsset(LLUUID assetID) + /// + /// Only get an asset if we already have it in the cache. + /// + /// + /// + private AssetBase GetCachedAsset(LLUUID assetID) { AssetBase asset = null; if (Textures.ContainsKey(assetID)) @@ -153,7 +158,7 @@ namespace OpenSim.Framework.Communications.Cache public AssetBase GetAsset(LLUUID assetID, bool isTexture) { - AssetBase asset = GetAsset(assetID); + AssetBase asset = GetCachedAsset(assetID); if (asset == null) { m_assetServer.RequestAsset(assetID, isTexture); @@ -223,7 +228,7 @@ namespace OpenSim.Framework.Communications.Cache public AssetBase CopyAsset(LLUUID assetID) { - AssetBase asset = GetAsset(assetID); + AssetBase asset = GetCachedAsset(assetID); if (asset == null) return null; -- cgit v1.1