diff options
author | Melanie | 2012-10-05 00:15:55 +0200 |
---|---|---|
committer | Melanie | 2012-10-05 00:15:55 +0200 |
commit | d5ea203f934416c4c703ca899c7981b2f5ee550c (patch) | |
tree | 102aa99d4bc4c51b3f73ce47d6f590802d44dc09 | |
parent | Allow default animation to be stopped to be replaced with another one. (diff) | |
download | opensim-SC-d5ea203f934416c4c703ca899c7981b2f5ee550c.zip opensim-SC-d5ea203f934416c4c703ca899c7981b2f5ee550c.tar.gz opensim-SC-d5ea203f934416c4c703ca899c7981b2f5ee550c.tar.bz2 opensim-SC-d5ea203f934416c4c703ca899c7981b2f5ee550c.tar.xz |
Fix threading in remote asset connector
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9d6d9ad..7f32ad3 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -295,25 +295,30 @@ namespace OpenSim.Services.Connectors | |||
295 | bool success = false; | 295 | bool success = false; |
296 | try | 296 | try |
297 | { | 297 | { |
298 | AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, | 298 | AssetBase a = SynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 30); |
299 | delegate(AssetBase a) | 299 | if (a != null) |
300 | { | 300 | { |
301 | if (m_Cache != null) | 301 | if (m_Cache != null) |
302 | m_Cache.Cache(a); | 302 | m_Cache.Cache(a); |
303 | 303 | ||
304 | List<AssetRetrievedEx> handlers; | 304 | List<AssetRetrievedEx> handlers; |
305 | lock (m_AssetHandlers) | 305 | lock (m_AssetHandlers) |
306 | { | ||
307 | handlers = m_AssetHandlers[id]; | ||
308 | m_AssetHandlers.Remove(id); | ||
309 | } | ||
310 | foreach (AssetRetrievedEx h in handlers) | ||
311 | { | ||
312 | Util.FireAndForget(x => | ||
306 | { | 313 | { |
307 | handlers = m_AssetHandlers[id]; | ||
308 | m_AssetHandlers.Remove(id); | ||
309 | } | ||
310 | foreach (AssetRetrievedEx h in handlers) | ||
311 | h.Invoke(a); | 314 | h.Invoke(a); |
312 | if (handlers != null) | 315 | }); |
313 | handlers.Clear(); | 316 | } |
314 | }, 30); | 317 | if (handlers != null) |
318 | handlers.Clear(); | ||
315 | 319 | ||
316 | success = true; | 320 | success = true; |
321 | } | ||
317 | } | 322 | } |
318 | finally | 323 | finally |
319 | { | 324 | { |
@@ -326,7 +331,7 @@ namespace OpenSim.Services.Connectors | |||
326 | m_AssetHandlers.Remove(id); | 331 | m_AssetHandlers.Remove(id); |
327 | } | 332 | } |
328 | if (handlers != null) | 333 | if (handlers != null) |
329 | handlers.Clear(); | 334 | handlers.Clear(); |
330 | } | 335 | } |
331 | } | 336 | } |
332 | } | 337 | } |