diff options
author | Melanie | 2012-06-26 10:49:37 +0200 |
---|---|---|
committer | Melanie | 2012-06-26 10:49:37 +0200 |
commit | 9a8de52940ea6d9ce430d8d51094a353eca7d3c5 (patch) | |
tree | 900381245784707596ce8c03214a8025e5109e2f /OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |
parent | Disable physics raycast until it can be seen to. Fix distance calculation (diff) | |
download | opensim-SC-9a8de52940ea6d9ce430d8d51094a353eca7d3c5.zip opensim-SC-9a8de52940ea6d9ce430d8d51094a353eca7d3c5.tar.gz opensim-SC-9a8de52940ea6d9ce430d8d51094a353eca7d3c5.tar.bz2 opensim-SC-9a8de52940ea6d9ce430d8d51094a353eca7d3c5.tar.xz |
Add an event to the poll service manager thread to allow starting it
when needed rather than once per second. That is just too slow!
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 0062d4e..c3e1a79 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -41,6 +41,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
41 | 41 | ||
42 | private readonly BaseHttpServer m_server; | 42 | private readonly BaseHttpServer m_server; |
43 | private static Queue m_requests = Queue.Synchronized(new Queue()); | 43 | private static Queue m_requests = Queue.Synchronized(new Queue()); |
44 | private static ManualResetEvent m_ev = new ManualResetEvent(false); | ||
44 | private uint m_WorkerThreadCount = 0; | 45 | private uint m_WorkerThreadCount = 0; |
45 | private Thread[] m_workerThreads; | 46 | private Thread[] m_workerThreads; |
46 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; | 47 | private PollServiceWorkerThread[] m_PollServiceWorkerThreads; |
@@ -88,15 +89,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
88 | { | 89 | { |
89 | lock (m_requests) | 90 | lock (m_requests) |
90 | m_requests.Enqueue(req); | 91 | m_requests.Enqueue(req); |
92 | m_ev.Set(); | ||
91 | } | 93 | } |
92 | 94 | ||
93 | public void ThreadStart() | 95 | public void ThreadStart() |
94 | { | 96 | { |
95 | while (m_running) | 97 | while (m_running) |
96 | { | 98 | { |
99 | m_ev.WaitOne(1000); | ||
100 | m_ev.Reset(); | ||
97 | Watchdog.UpdateThread(); | 101 | Watchdog.UpdateThread(); |
98 | ProcessQueuedRequests(); | 102 | ProcessQueuedRequests(); |
99 | Thread.Sleep(1000); | ||
100 | } | 103 | } |
101 | } | 104 | } |
102 | 105 | ||
@@ -152,4 +155,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
152 | m_running = false; | 155 | m_running = false; |
153 | } | 156 | } |
154 | } | 157 | } |
155 | } \ No newline at end of file | 158 | } |