aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-06-10 23:30:35 +0100
committerJustin Clark-Casey (justincc)2013-06-10 23:30:35 +0100
commit32d1e50565787eaf8fac8b5f0bd899b6e3b3b303 (patch)
tree239d01894c5c73755f14077c2ce8f3d290bcff26 /OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-32d1e50565787eaf8fac8b5f0bd899b6e3b3b303.zip
opensim-SC_OLD-32d1e50565787eaf8fac8b5f0bd899b6e3b3b303.tar.gz
opensim-SC_OLD-32d1e50565787eaf8fac8b5f0bd899b6e3b3b303.tar.bz2
opensim-SC_OLD-32d1e50565787eaf8fac8b5f0bd899b6e3b3b303.tar.xz
Reinstate explicit starting and stopping of PollServiceRequestManager added in 3eee991 but removed in 7c0bfca
Do not rely on destructors to stop things. These fire at unpredictable times and cause problems such as http://opensimulator.org/mantis/view.php?id=6503 and most probably http://opensimulator.org/mantis/view.php?id=6668
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index a5380c1..ef35886 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -66,7 +66,10 @@ namespace OpenSim.Framework.Servers.HttpServer
66 m_server = pSrv; 66 m_server = pSrv;
67 m_WorkerThreadCount = pWorkerThreadCount; 67 m_WorkerThreadCount = pWorkerThreadCount;
68 m_workerThreads = new Thread[m_WorkerThreadCount]; 68 m_workerThreads = new Thread[m_WorkerThreadCount];
69 }
69 70
71 public void Start()
72 {
70 //startup worker threads 73 //startup worker threads
71 for (uint i = 0; i < m_WorkerThreadCount; i++) 74 for (uint i = 0; i < m_WorkerThreadCount; i++)
72 { 75 {
@@ -91,7 +94,6 @@ namespace OpenSim.Framework.Servers.HttpServer
91 1000 * 60 * 10); 94 1000 * 60 * 10);
92 } 95 }
93 96
94
95 private void ReQueueEvent(PollServiceHttpRequest req) 97 private void ReQueueEvent(PollServiceHttpRequest req)
96 { 98 {
97 if (m_running) 99 if (m_running)
@@ -142,14 +144,14 @@ namespace OpenSim.Framework.Servers.HttpServer
142 } 144 }
143 } 145 }
144 146
145 ~PollServiceRequestManager() 147 public void Stop()
146 { 148 {
147 m_running = false; 149 m_running = false;
148// m_timeout = -10000; // cause all to expire 150// m_timeout = -10000; // cause all to expire
149 Thread.Sleep(1000); // let the world move 151 Thread.Sleep(1000); // let the world move
150 152
151 foreach (Thread t in m_workerThreads) 153 foreach (Thread t in m_workerThreads)
152 Watchdog.AbortThread(t.ManagedThreadId); 154 Watchdog.AbortThread(t.ManagedThreadId);
153 155
154 try 156 try
155 { 157 {