diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 5406f00..44f7045 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |||
@@ -64,14 +64,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
64 | m_server = pSrv; | 64 | m_server = pSrv; |
65 | m_WorkerThreadCount = pWorkerThreadCount; | 65 | m_WorkerThreadCount = pWorkerThreadCount; |
66 | m_workerThreads = new Thread[m_WorkerThreadCount]; | 66 | m_workerThreads = new Thread[m_WorkerThreadCount]; |
67 | } | ||
67 | 68 | ||
69 | public void Start() | ||
70 | { | ||
68 | //startup worker threads | 71 | //startup worker threads |
69 | for (uint i = 0; i < m_WorkerThreadCount; i++) | 72 | for (uint i = 0; i < m_WorkerThreadCount; i++) |
70 | { | 73 | { |
71 | m_workerThreads[i] | 74 | m_workerThreads[i] |
72 | = Watchdog.StartThread( | 75 | = Watchdog.StartThread( |
73 | PoolWorkerJob, | 76 | PoolWorkerJob, |
74 | String.Format("PollServiceWorkerThread{0}", i), | 77 | string.Format("PollServiceWorkerThread{0}:{1}", i, m_server.Port), |
75 | ThreadPriority.Normal, | 78 | ThreadPriority.Normal, |
76 | false, | 79 | false, |
77 | false, | 80 | false, |
@@ -81,7 +84,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
81 | 84 | ||
82 | m_retrysThread = Watchdog.StartThread( | 85 | m_retrysThread = Watchdog.StartThread( |
83 | this.CheckRetries, | 86 | this.CheckRetries, |
84 | "PollServiceWatcherThread", | 87 | string.Format("PollServiceWatcherThread:{0}", m_server.Port), |
85 | ThreadPriority.Normal, | 88 | ThreadPriority.Normal, |
86 | false, | 89 | false, |
87 | true, | 90 | true, |
@@ -89,7 +92,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
89 | 1000 * 60 * 10); | 92 | 1000 * 60 * 10); |
90 | } | 93 | } |
91 | 94 | ||
92 | |||
93 | private void ReQueueEvent(PollServiceHttpRequest req) | 95 | private void ReQueueEvent(PollServiceHttpRequest req) |
94 | { | 96 | { |
95 | if (m_running) | 97 | if (m_running) |
@@ -103,7 +105,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
103 | { | 105 | { |
104 | if (m_running) | 106 | if (m_running) |
105 | { | 107 | { |
106 | if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.Normal) | 108 | if (req.PollServiceArgs.Type != PollServiceEventArgs.EventType.LongPoll) |
107 | { | 109 | { |
108 | m_requests.Enqueue(req); | 110 | m_requests.Enqueue(req); |
109 | } | 111 | } |
@@ -140,13 +142,13 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
140 | } | 142 | } |
141 | } | 143 | } |
142 | 144 | ||
143 | ~PollServiceRequestManager() | 145 | public void Stop() |
144 | { | 146 | { |
145 | m_running = false; | 147 | m_running = false; |
146 | Thread.Sleep(1000); // let the world move | 148 | Thread.Sleep(1000); // let the world move |
147 | 149 | ||
148 | foreach (Thread t in m_workerThreads) | 150 | foreach (Thread t in m_workerThreads) |
149 | Watchdog.AbortThread(t.ManagedThreadId); | 151 | Watchdog.AbortThread(t.ManagedThreadId); |
150 | 152 | ||
151 | try | 153 | try |
152 | { | 154 | { |
@@ -205,7 +207,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
205 | if (responsedata == null) | 207 | if (responsedata == null) |
206 | continue; | 208 | continue; |
207 | 209 | ||
208 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.Normal) // This is the event queue | 210 | if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) // This is the event queue |
209 | { | 211 | { |
210 | try | 212 | try |
211 | { | 213 | { |