1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00

Print a useful debug log if we cannot safely terminate a task

This commit is contained in:
SquidDev 2018-04-24 11:07:33 +01:00
parent a42793024b
commit cac65ef755

View File

@ -224,6 +224,23 @@ private void execute( BlockingQueue<ITask> queue ) throws InterruptedException
// Interrupt the thread
if( !done )
{
StringBuilder builder = new StringBuilder( "Terminating " );
if( computer != null )
{
builder.append( "computer " ).append( computer.getID() );
}
else
{
builder.append( "unknown computer" );
}
builder.append( ". Thread is currently running" );
for( StackTraceElement element : thread.getStackTrace() )
{
builder.append( "\n at " ).append( element );
}
ComputerCraft.log.error( builder.toString() );
thread.interrupt();
thread = null;
runner = null;