diff options
author | Melanie | 2012-07-06 00:23:05 +0200 |
---|---|---|
committer | Melanie | 2012-07-06 00:23:05 +0200 |
commit | b8c2efa49c35d623a6a2969322536fde67cb86dc (patch) | |
tree | ea0742dc5819b847bd24feb5b29d3e77363fd11e /OpenSim | |
parent | Fix the boo-boo (diff) | |
download | opensim-SC-b8c2efa49c35d623a6a2969322536fde67cb86dc.zip opensim-SC-b8c2efa49c35d623a6a2969322536fde67cb86dc.tar.gz opensim-SC-b8c2efa49c35d623a6a2969322536fde67cb86dc.tar.bz2 opensim-SC-b8c2efa49c35d623a6a2969322536fde67cb86dc.tar.xz |
Convert the slow request queue into a regular queue and add some cleanup
and locking.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 06745f9..6f87c85 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -174,7 +174,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
174 | private readonly BaseHttpServer m_server; | 174 | private readonly BaseHttpServer m_server; |
175 | 175 | ||
176 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); | 176 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); |
177 | private BlockingQueue<PollServiceHttpRequest> m_slowRequests = new BlockingQueue<PollServiceHttpRequest>(); | 177 | private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>(); |
178 | private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>(); | 178 | private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>(); |
179 | 179 | ||
180 | private uint m_WorkerThreadCount = 0; | 180 | private uint m_WorkerThreadCount = 0; |
@@ -229,9 +229,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
229 | if (m_running) | 229 | if (m_running) |
230 | { | 230 | { |
231 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LslHttp) | 231 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LslHttp) |
232 | { | ||
232 | m_requests.Enqueue(req); | 233 | m_requests.Enqueue(req); |
234 | } | ||
233 | else | 235 | else |
234 | m_slowRequests.Enqueue(req); | 236 | { |
237 | lock (m_slowRequests) | ||
238 | m_slowRequests.Enqueue(req); | ||
239 | } | ||
235 | } | 240 | } |
236 | } | 241 | } |
237 | 242 | ||
@@ -251,8 +256,11 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
251 | { | 256 | { |
252 | slowCount = 0; | 257 | slowCount = 0; |
253 | 258 | ||
254 | while (m_slowRequests.Count() > 0 && m_running) | 259 | lock (m_slowRequests) |
255 | m_requests.Enqueue(m_slowRequests.Dequeue()); | 260 | { |
261 | while (m_slowRequests.Count > 0 && m_running) | ||
262 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
263 | } | ||
256 | } | 264 | } |
257 | } | 265 | } |
258 | } | 266 | } |
@@ -290,6 +298,12 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
290 | PollServiceHttpRequest wreq; | 298 | PollServiceHttpRequest wreq; |
291 | m_retryRequests.Clear(); | 299 | m_retryRequests.Clear(); |
292 | 300 | ||
301 | lock (m_slowRequests) | ||
302 | { | ||
303 | while (m_slowRequests.Count > 0 && m_running) | ||
304 | m_requests.Enqueue(m_slowRequests.Dequeue()); | ||
305 | } | ||
306 | |||
293 | while (m_requests.Count() > 0) | 307 | while (m_requests.Count() > 0) |
294 | { | 308 | { |
295 | try | 309 | try |