mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
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:
25
OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs
Normal file → Executable file
25
OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs
Normal file → Executable file
@@ -204,19 +204,26 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private static void DoAssetRequests()
|
||||
{
|
||||
while (m_NumberScenes > 0)
|
||||
try
|
||||
{
|
||||
APollRequest poolreq;
|
||||
if(m_queue.TryTake(out poolreq, 4500))
|
||||
while (m_NumberScenes > 0)
|
||||
{
|
||||
if (m_NumberScenes <= 0)
|
||||
break;
|
||||
APollRequest poolreq;
|
||||
if (m_queue.TryTake(out poolreq, 4500))
|
||||
{
|
||||
if (m_NumberScenes <= 0)
|
||||
break;
|
||||
Watchdog.UpdateThread();
|
||||
if (poolreq.reqID != UUID.Zero)
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
poolreq = null;
|
||||
}
|
||||
Watchdog.UpdateThread();
|
||||
if (poolreq.reqID != UUID.Zero)
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
poolreq = null;
|
||||
}
|
||||
Watchdog.UpdateThread();
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
Thread.ResetAbort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
23
OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
Normal file → Executable file
23
OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
Normal file → Executable file
@@ -395,17 +395,26 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private static void DoInventoryRequests()
|
||||
{
|
||||
while (true)
|
||||
bool running = true;
|
||||
while (running)
|
||||
{
|
||||
APollRequest poolreq;
|
||||
if (m_queue.TryTake(out poolreq, 4500))
|
||||
try
|
||||
{
|
||||
APollRequest poolreq;
|
||||
if (m_queue.TryTake(out poolreq, 4500))
|
||||
{
|
||||
Watchdog.UpdateThread();
|
||||
if (poolreq.thepoll != null)
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
poolreq = null;
|
||||
}
|
||||
Watchdog.UpdateThread();
|
||||
if (poolreq.thepoll != null)
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
poolreq = null;
|
||||
}
|
||||
Watchdog.UpdateThread();
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
Thread.ResetAbort();
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
Normal file → Executable file
6
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
Normal file → Executable file
@@ -1910,7 +1910,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
incomingPacket = null;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
Thread.ResetAbort();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("[LLUDPSERVER]: Error in the incoming packet handler loop: " + ex.Message, ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user