摘要:
public class MySynchronizedTest implements Runnable {//线程加锁时应是同一对象 int i=100; Object object=new Object(); boolean flag=true; //对方法加锁 public synchronized void count1() { while(flag){ try {//睡眠200ms Thread.sleep(200); } catch (InterruptedException e) { // TODO Auto-generated catch block ... 阅读全文
posted @ 2013-07-28 23:12
孟子hehe
阅读(183)
评论(0)
推荐(0)
浙公网安备 33010602011771号