diff options
author | Justin Clarke Casey | 2008-09-21 17:49:52 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-21 17:49:52 +0000 |
commit | 52f0c8d15d0d8a43a809d0f94f96dd115a6d3766 (patch) | |
tree | d93e0cdf1b6a0358511d5817eeae64ae177b8193 /OpenSim/Framework | |
parent | Fix another reason for #2218 (diff) | |
download | opensim-SC-52f0c8d15d0d8a43a809d0f94f96dd115a6d3766.zip opensim-SC-52f0c8d15d0d8a43a809d0f94f96dd115a6d3766.tar.gz opensim-SC-52f0c8d15d0d8a43a809d0f94f96dd115a6d3766.tar.bz2 opensim-SC-52f0c8d15d0d8a43a809d0f94f96dd115a6d3766.tar.xz |
* minor: tidy up of AssetCache, remove currently pointless storing of thread reference
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 3e88eba..c6f41a6 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
68 | /// <summary> | 68 | /// <summary> |
69 | /// Assets requests which are waiting for asset server data. This includes texture requests | 69 | /// Assets requests which are waiting for asset server data. This includes texture requests |
70 | /// </summary> | 70 | /// </summary> |
71 | private Dictionary<UUID, AssetRequest> RequestedAssets; | 71 | private Dictionary<UUID, AssetRequest> RequestedAssets; |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. | 74 | /// Asset requests with data which are ready to be sent back to requesters. This includes textures. |
@@ -80,10 +80,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
80 | /// </summary> | 80 | /// </summary> |
81 | private Dictionary<UUID, AssetRequestsList> RequestLists; | 81 | private Dictionary<UUID, AssetRequestsList> RequestLists; |
82 | 82 | ||
83 | /// <summary> | ||
84 | /// The 'server' from which assets can be requested and to which assets are persisted. | ||
85 | /// </summary> | ||
83 | private readonly IAssetServer m_assetServer; | 86 | private readonly IAssetServer m_assetServer; |
84 | 87 | ||
85 | private readonly Thread m_assetCacheThread; | ||
86 | |||
87 | /// <summary> | 88 | /// <summary> |
88 | /// Report statistical data. | 89 | /// Report statistical data. |
89 | /// </summary> | 90 | /// </summary> |
@@ -175,11 +176,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
175 | m_assetServer = assetServer; | 176 | m_assetServer = assetServer; |
176 | m_assetServer.SetReceiver(this); | 177 | m_assetServer.SetReceiver(this); |
177 | 178 | ||
178 | m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); | 179 | Thread assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); |
179 | m_assetCacheThread.Name = "AssetCacheThread"; | 180 | assetCacheThread.Name = "AssetCacheThread"; |
180 | m_assetCacheThread.IsBackground = true; | 181 | assetCacheThread.IsBackground = true; |
181 | m_assetCacheThread.Start(); | 182 | assetCacheThread.Start(); |
182 | ThreadTracker.Add(m_assetCacheThread); | 183 | ThreadTracker.Add(assetCacheThread); |
183 | } | 184 | } |
184 | 185 | ||
185 | /// <summary> | 186 | /// <summary> |
@@ -252,7 +253,6 @@ namespace OpenSim.Framework.Communications.Cache | |||
252 | { | 253 | { |
253 | //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); | 254 | //m_log.DebugFormat("[ASSET CACHE]: Requesting {0} {1}", isTexture ? "texture" : "asset", assetId); |
254 | 255 | ||
255 | |||
256 | // Xantor 20080526: | 256 | // Xantor 20080526: |
257 | // if a request is made for an asset which is not in the cache yet, but has already been requested by | 257 | // if a request is made for an asset which is not in the cache yet, but has already been requested by |
258 | // something else, queue up the callbacks on that requestor instead of swamping the assetserver | 258 | // something else, queue up the callbacks on that requestor instead of swamping the assetserver |
@@ -266,9 +266,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
266 | } | 266 | } |
267 | else | 267 | else |
268 | { | 268 | { |
269 | #if DEBUG | ||
270 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); | 269 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); |
271 | #endif | ||
272 | 270 | ||
273 | NewAssetRequest req = new NewAssetRequest(assetId, callback); | 271 | NewAssetRequest req = new NewAssetRequest(assetId, callback); |
274 | AssetRequestsList requestList; | 272 | AssetRequestsList requestList; |
@@ -389,7 +387,6 @@ namespace OpenSim.Framework.Communications.Cache | |||
389 | /// real solution here is a much better cache archicture, but | 387 | /// real solution here is a much better cache archicture, but |
390 | /// this is a stop gap measure until we have such a thing. | 388 | /// this is a stop gap measure until we have such a thing. |
391 | /// </summary> | 389 | /// </summary> |
392 | |||
393 | public void ExpireAsset(UUID uuid) | 390 | public void ExpireAsset(UUID uuid) |
394 | { | 391 | { |
395 | // uuid is unique, so no need to worry about it showing up | 392 | // uuid is unique, so no need to worry about it showing up |