aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-05 17:38:27 -0700
committerJohn Hurliman2009-10-05 17:38:27 -0700
commit7ddb6fbced5f2a98aa0201e354987ebc32adf7d2 (patch)
tree903b87112e7f851218e7b3d41c681f1b8f512af2 /OpenSim/Region/ClientStack/LindenUDP
parentBeginning work on the new LLUDP implementation (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.zip
opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.gz
opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.bz2
opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into htb-throttle
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs42
1 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 5219df7..343f537 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 J2KImage imgrequest; 88 J2KImage imgrequest;
89 89
90 // Do a linear search for this texture download 90 // Do a linear search for this texture download
91 lock (m_priorityQueue) 91 lock (m_syncRoot)
92 m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest); 92 m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest);
93 93
94 if (imgrequest != null) 94 if (imgrequest != null)
@@ -99,7 +99,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
99 99
100 try 100 try
101 { 101 {
102 lock (m_priorityQueue) 102 lock (m_syncRoot)
103 m_priorityQueue.Delete(imgrequest.PriorityQueueHandle); 103 m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
104 } 104 }
105 catch (Exception) { } 105 catch (Exception) { }
@@ -167,8 +167,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
167 J2KImage imagereq; 167 J2KImage imagereq;
168 int numCollected = 0; 168 int numCollected = 0;
169 169
170 lock (m_syncRoot) 170 //lock (m_syncRoot)
171 { 171 //{
172 m_lastloopprocessed = DateTime.Now.Ticks; 172 m_lastloopprocessed = DateTime.Now.Ticks;
173 173
174 // This can happen during Close() 174 // This can happen during Close()
@@ -191,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
191 if (numCollected == count) 191 if (numCollected == count)
192 break; 192 break;
193 } 193 }
194 } 194 //}
195 195
196 return m_priorityQueue.Count > 0; 196 return m_priorityQueue.Count > 0;
197 } 197 }
@@ -211,16 +211,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
211 { 211 {
212 J2KImage image = null; 212 J2KImage image = null;
213 213
214 if (m_priorityQueue.Count > 0) 214 lock (m_syncRoot)
215 { 215 {
216 try 216
217 if (m_priorityQueue.Count > 0)
217 { 218 {
218 lock (m_priorityQueue) 219 try
220 {
219 image = m_priorityQueue.FindMax(); 221 image = m_priorityQueue.FindMax();
222 }
223 catch (Exception) { }
220 } 224 }
221 catch (Exception) { }
222 } 225 }
223
224 return image; 226 return image;
225 } 227 }
226 228
@@ -228,23 +230,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
228 { 230 {
229 image.PriorityQueueHandle = null; 231 image.PriorityQueueHandle = null;
230 232
231 lock (m_priorityQueue) 233 lock (m_syncRoot)
232 m_priorityQueue.Add(ref image.PriorityQueueHandle, image); 234 try
235 {
236 m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
237 }
238 catch (Exception) { }
233 } 239 }
234 240
235 void RemoveImageFromQueue(J2KImage image) 241 void RemoveImageFromQueue(J2KImage image)
236 { 242 {
237 try 243 lock (m_syncRoot)
238 { 244 try
239 lock (m_priorityQueue) 245 {
240 m_priorityQueue.Delete(image.PriorityQueueHandle); 246 m_priorityQueue.Delete(image.PriorityQueueHandle);
241 } 247 }
242 catch (Exception) { } 248 catch (Exception) { }
243 } 249 }
244 250
245 void UpdateImageInQueue(J2KImage image) 251 void UpdateImageInQueue(J2KImage image)
246 { 252 {
247 lock (m_priorityQueue) 253 lock (m_syncRoot)
248 { 254 {
249 try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); } 255 try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); }
250 catch (Exception) 256 catch (Exception)