自旋功能很简单,实用,有许多人 却不知道使用。下面列举一例子,供参考
public volitale boolean a = true;
private boolean doSpin(){
while(a){
thread.sleep(1000);
a = false;
}
return true;
}
public volitale boolean a = true;
private boolean doSpin(){
while(a){
thread.sleep(1000);
a = false;
}
return true;
}