由买买提看人间百态

topics

全部话题 - 话题: synobject
(共0页)
q*********u
发帖数: 280
1
来自主题: Java版 - a fun coding question
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
(共0页)