mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-04 11:02:54 +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
|
// Interrupt the thread
|
||||||
if( !done )
|
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.interrupt();
|
||||||
thread = null;
|
thread = null;
|
||||||
runner = null;
|
runner = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user