q*********u 发帖数: 280 | 1 package multithread;
class SynObject{
public int counter;
public SynObject(){
counter = 0;
}
public SynObject(int cnt){
counter = cnt;
}
}
class Thread3 extends Thread{
public SynObject obj;
public Thread3(SynObject obj){
this.obj = obj;
}
public void run(){
synchronized(obj){
System.out.println("Thread3, before while() lo |
|