From 8d8236cfb245eaa25f81f2840175b8fe676febbd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 26 May 2017 00:34:04 +0100 Subject: [PATCH] missing file change.. actually use watchdog threads on assetsconnector and avoid null refs on JobEngine --- OpenSim/Framework/Monitoring/JobEngine.cs | 7 +++++-- .../Connectors/Asset/AssetServicesConnector.cs | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index 0a39e4b6be..a6a059dcc6 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs @@ -136,12 +136,15 @@ namespace OpenSim.Framework.Monitoring if(m_jobQueue.Count <= 0) m_cancelSource.Cancel(); - if(m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop)) + m_finishedProcessingAfterStop.WaitOne(RequestProcessTimeoutOnStop); m_finishedProcessingAfterStop.Close(); } finally { - m_cancelSource.Dispose(); + if(m_cancelSource != null) + m_cancelSource.Dispose(); + if(m_finishedProcessingAfterStop != null) + m_finishedProcessingAfterStop.Dispose(); } } } diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 2deb2d1100..7e81be7fa0 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -34,7 +34,7 @@ using System.Reflection; using System.Timers; using Nini.Config; using OpenSim.Framework; -using OpenSim.Framework.Console; +using OpenSim.Framework.Monitoring; using OpenSim.Services.Interfaces; using OpenMetaverse; @@ -135,7 +135,11 @@ namespace OpenSim.Services.Connectors for (int i = 0 ; i < 2 ; i++) { - Util.FireAndForget(delegate { AssetRequestProcessor();}); + m_fetchThreads[i] = WorkManager.StartThread(AssetRequestProcessor, + String.Format("GetTextureWorker{0}", i), + ThreadPriority.Normal, + true, + false); } } @@ -357,7 +361,8 @@ namespace OpenSim.Services.Connectors while (true) { - r = m_requestQueue.Dequeue(2000); + r = m_requestQueue.Dequeue(4500); + Watchdog.UpdateThread(); if(r== null) continue; string uri = r.uri;