假设我有一个这样的线程类:
public class ThreadClass extends Thread{
Object object = new Object(); //relevant object
public void run(){
synchronized(object){
if(/*condition is true*/){
//do transactions here
}else{
try{
object.wait();
}catch(InterruptedException e){
//if thread was interrupted
}
}
//other transactions here
}
}
}
如果当前线程被中断,它会继续它的事务吗?它还会在这里进行其他交易吗?谢谢。