From f3eb73926e1602f855f2c7fceb040b07f7265f3b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 23 May 2017 04:05:31 +0100 Subject: [PATCH] stop a few more threads on exit --- OpenSim/Framework/Monitoring/WorkManager.cs | 6 +++- .../Framework/Servers/BaseOpenSimServer.cs | 2 ++ .../Api/Implementation/AsyncCommandManager.cs | 30 +++++++++---------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs index 43130f9a0b..a3e03904eb 100644 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs @@ -82,6 +82,11 @@ namespace OpenSim.Framework.Monitoring HandleControlCommand); } + public static void Stop() + { + JobEngine.Stop(); + } + /// /// Start a new long-lived thread. /// @@ -131,7 +136,6 @@ namespace OpenSim.Framework.Monitoring thread.Start(); - return thread; } diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 99d94bb6a3..7d21e000e3 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -116,6 +116,8 @@ namespace OpenSim.Framework.Servers Thread.Sleep(5000); + WorkManager.Stop(); + RemovePIDFile(); m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 6a39bb95e0..2a31efd554 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs @@ -197,20 +197,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ~AsyncCommandManager() { // Shut down thread -// try -// { -// if (cmdHandlerThread != null) -// { -// if (cmdHandlerThread.IsAlive == true) -// { -// cmdHandlerThread.Abort(); -// //cmdHandlerThread.Join(); -// } -// } -// } -// catch -// { -// } + try + { + if (cmdHandlerThread != null) + { + if (cmdHandlerThread.IsAlive == true) + { + cmdHandlerThread.Abort(); + //cmdHandlerThread.Join(); + } + } + } + catch + { + } } /// @@ -387,8 +387,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - - public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) { List data = new List();