Add Thread.ResetAbort() to various thread loops to clean up errors on

shutdown. Fixes Mantis #8494.

Threads are aborted when shutting down and ThreadAbortException is odd
in that it is rethrown at the end of the catch unless the abort is
reset. No functional changes but fewer error messages on shutdown.
This commit is contained in:
Robert Adams
2019-02-27 07:49:52 -08:00
parent 9e182c27fb
commit bd1b992aaf
5 changed files with 64 additions and 33 deletions

View File

@@ -221,7 +221,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// </summary>
private static void CmdHandlerThreadLoop()
{
while (true)
bool running = true;
while (running)
{
try
{
@@ -230,7 +231,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
DoOneCmdHandlerPass();
Watchdog.UpdateThread();
}
catch ( System.Threading.ThreadAbortException) { }
catch ( System.Threading.ThreadAbortException)
{
Thread.ResetAbort();
running = false;
}
catch (Exception e)
{
m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);