调用线程的interrupt()方法,它将产生一个InterruptedException异常,捕获这个异常,在catch()中return即可;
例:
try{
thread.interrupt();
}
catch(InterruptedException e){
return;
}
例:
try{
thread.interrupt();
}
catch(InterruptedException e){
return;
}
void halt(int status) of Runtime