mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Add "threads abort <thread-id>" simulator console command that allows us to abort a watchdog managed thread.
This is for diagnostic purposes.
This commit is contained in:
@@ -112,8 +112,10 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Stops watchdog tracking on the current thread
|
||||
/// </summary>
|
||||
/// <returns>True if the thread was removed from the list of tracked
|
||||
/// threads, otherwise false</returns>
|
||||
/// <returns>
|
||||
/// True if the thread was removed from the list of tracked
|
||||
/// threads, otherwise false
|
||||
/// </returns>
|
||||
public static bool RemoveThread()
|
||||
{
|
||||
return RemoveThread(Thread.CurrentThread.ManagedThreadId);
|
||||
@@ -133,6 +135,25 @@ namespace OpenSim.Framework
|
||||
return m_threads.Remove(threadID);
|
||||
}
|
||||
|
||||
public static bool AbortThread(int threadID)
|
||||
{
|
||||
lock (m_threads)
|
||||
{
|
||||
if (m_threads.ContainsKey(threadID))
|
||||
{
|
||||
ThreadWatchdogInfo twi = m_threads[threadID];
|
||||
twi.Thread.Abort();
|
||||
RemoveThread(threadID);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateThread(int threadID)
|
||||
{
|
||||
ThreadWatchdogInfo threadInfo;
|
||||
|
||||
Reference in New Issue
Block a user