aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/JobEngine.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs
index a32e4aa..6db9a67 100644
--- a/OpenSim/Framework/Monitoring/JobEngine.cs
+++ b/OpenSim/Framework/Monitoring/JobEngine.cs
@@ -161,7 +161,6 @@ namespace OpenSim.Framework.Monitoring
161 finally 161 finally
162 { 162 {
163 m_cancelSource.Dispose(); 163 m_cancelSource.Dispose();
164 m_jobQueue = null;
165 } 164 }
166 } 165 }
167 } 166 }
@@ -250,7 +249,19 @@ namespace OpenSim.Framework.Monitoring
250 { 249 {
251 while (IsRunning || m_jobQueue.Count > 0) 250 while (IsRunning || m_jobQueue.Count > 0)
252 { 251 {
253 CurrentJob = m_jobQueue.Take(m_cancelSource.Token); 252 try
253 {
254 CurrentJob = m_jobQueue.Take(m_cancelSource.Token);
255 }
256 catch (ObjectDisposedException e)
257 {
258 // If we see this whilst not running then it may be due to a race where this thread checks
259 // IsRunning after the stopping thread sets it to false and disposes of the cancellation source.
260 if (IsRunning)
261 throw e;
262 else
263 break;
264 }
254 265
255 if (LogLevel >= 1) 266 if (LogLevel >= 1)
256 m_log.DebugFormat("[{0}]: Processing job {1}", LoggingName, CurrentJob.Name); 267 m_log.DebugFormat("[{0}]: Processing job {1}", LoggingName, CurrentJob.Name);