mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-02-13 01:20:04 +00:00
Print a useful debug log if we cannot safely terminate a task
This commit is contained in:
parent
a42793024b
commit
cac65ef755
@ -224,6 +224,23 @@ public class ComputerThread
|
||||
// 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user